Returns an integer indicating whether this cursor is before, after, or at the same position as the specified cursor.
a.comparePosition(b) < 0 means a is to the left of b. a.comparePosition(b) == 0 means a is at the same position as b. a.comparePosition(b) > 0 means a is to the right of b.
The sort order of cursors in the document is the token order. For example, if cursor "a" is at a START token and the cursor "b" is at a token within the contents of the same element, then a.comparePosition(b) will return -1, meaning that the position of a is before b.
@param cursor The cursor whose position should be comparedwith this cursor.
@return 1 if this cursor is after the specified cursor; 0 if this cursor is at the same position as the specified cursor; -1 if this cursor is before the specified cursor.
@throws java.lang.IllegalArgumentException If the specifiedcursor is not in the same document as this cursor.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.