public int compare(Item a, Item b) { NodeInfo n1 = (NodeInfo) a; NodeInfo n2 = (NodeInfo) b; return n1.compareOrder(n2); } }
public int compare(NodeInfo a, NodeInfo b) { NodeInfo n1 = (NodeInfo)a; NodeInfo n2 = (NodeInfo)b; return n1.compareOrder(n2); } }
public int compare(NodeInfo a, NodeInfo b) { NodeInfo n1 = (NodeInfo)a; NodeInfo n2 = (NodeInfo)b; return n1.compareOrder(n2); } }
public int compare(Item a, Item b) { NodeInfo n1 = (NodeInfo) a; NodeInfo n2 = (NodeInfo) b; return n1.compareOrder(n2); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this * node * @return -1 if this node precedes the other node, +1 if it follows the * other node, or 0 if they are the same node. (In this case, * isSameNode() will always return true, and the two nodes will * produce the same result for generateId()) */ public int compareOrder(NodeInfo other) { return original.compareOrder(((VirtualCopy)other).original); }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(/*@NotNull*/ NodeInfo other) { if (other instanceof AbstractVirtualNode) { return node.compareOrder(((AbstractVirtualNode) other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(NodeInfo other) { if (other instanceof StrippedNode) { return node.compareOrder(((StrippedNode)other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(/*@NotNull*/ NodeInfo other) { if (other instanceof SpaceStrippedNode) { return node.compareOrder(((SpaceStrippedNode) other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this * node * @return -1 if this node precedes the other node, +1 if it follows the * other node, or 0 if they are the same node. (In this case, * isSameNode() will always return true, and the two nodes will * produce the same result for generateId()) */ public int compareOrder(NodeInfo other) { return original.compareOrder(((VirtualCopy)other).original); }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(NodeInfo other) { if (other instanceof StrippedNode) { return node.compareOrder(((StrippedNode)other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(/*@NotNull*/ NodeInfo other) { if (other instanceof SpaceStrippedNode) { return node.compareOrder(((SpaceStrippedNode) other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(/*@NotNull*/ NodeInfo other) { if (other instanceof TypeStrippedNode) { return node.compareOrder(((TypeStrippedNode) other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(/*@NotNull*/ NodeInfo other) { if (other instanceof RebasedNode) { return node.compareOrder(((RebasedNode) other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(/*@NotNull*/ NodeInfo other) { if (other instanceof RebasedNode) { return node.compareOrder(((RebasedNode) other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(/*@NotNull*/ NodeInfo other) { if (other instanceof TypeStrippedNode) { return node.compareOrder(((TypeStrippedNode) other).node); } else { return node.compareOrder(other); } }
/** * Determine the relative position of this node and another node, in document order. * The other node will always be in the same document. * @param other The other node, whose position is to be compared with this node * @return -1 if this node precedes the other node, +1 if it follows the other * node, or 0 if they are the same node. (In this case, isSameNode() will always * return true, and the two nodes will produce the same result for generateId()) */ public int compareOrder(NodeInfo other) { if (other instanceof StrippedNode) { return node.compareOrder(((StrippedNode)other).node); } else { return node.compareOrder(other); } }
public int compare(NodeInfo a, NodeInfo b) { if (a==b) { return 0; } int d1 = a.getDocumentNumber(); int d2 = b.getDocumentNumber(); if (d1 == d2) { return a.compareOrder(b); } return d1 - d2; } }
public int compare(NodeInfo a, NodeInfo b) { if (a==b) { return 0; } int d1 = a.getDocumentNumber(); int d2 = b.getDocumentNumber(); if (d1 == d2) { return a.compareOrder(b); } return d1 - d2; } }
public int compare(Item a, /*@NotNull*/ Item b) { if (a == b) { return 0; } long d1 = ((NodeInfo) a).getTreeInfo().getDocumentNumber(); long d2 = ((NodeInfo) b).getTreeInfo().getDocumentNumber(); if (d1 == d2) { return ((NodeInfo) a).compareOrder((NodeInfo) b); } return Long.signum(d1 - d2); } }
public int compare(Item a, /*@NotNull*/ Item b) { if (a == b) { return 0; } long d1 = ((NodeInfo) a).getTreeInfo().getDocumentNumber(); long d2 = ((NodeInfo) b).getTreeInfo().getDocumentNumber(); if (d1 == d2) { return ((NodeInfo) a).compareOrder((NodeInfo) b); } return Long.signum(d1 - d2); } }