| java.lang.Object org.netbeans.modules.php.editor.completion.OffsetPair
OffsetPair | public class OffsetPair (Code) | | Container to store a pair of offsets related to a document.
A pair of offsets is able to describe a part of the text into the document,
e.g. selected text, token location and so on.
author: Victor G. Vasilyev |
Constructor Summary | |
public | OffsetPair(int startOffset, int endOffset) Creates OffsetPair instance and sort the specified
offsets so that getStartOffset() <= getEndOffset(). |
Method Summary | |
public int | getEndOffset() Fetches the offset from the beginning of the document that this
selection ends at. | public int | getStartOffset() Fetches the offset from the beginning of the document that this
selection begins at. | public boolean | isValid() Returns true if both offsets are valid, otherwise
false . | public int | length() Returns length of the entity (e.g. | public String | toString() |
OffsetPair | public OffsetPair(int startOffset, int endOffset)(Code) | | Creates OffsetPair instance and sort the specified
offsets so that getStartOffset() <= getEndOffset().
Parameters: startOffset - the offset from the beginning of the document Parameters: endOffset - the offset from the beginning of the document |
getEndOffset | public int getEndOffset()(Code) | | Fetches the offset from the beginning of the document that this
selection ends at.
the ending offset <= getStartOffset() |
getStartOffset | public int getStartOffset()(Code) | | Fetches the offset from the beginning of the document that this
selection begins at.
the starting offset >= 0 and <= getEndOffset() |
isValid | public boolean isValid()(Code) | | Returns true if both offsets are valid, otherwise
false .
true if both getStartOffset() and getEndOffset() > 0, otherwise false . |
length | public int length()(Code) | | Returns length of the entity (e.g. text) that is specified by the
underlying OffsetPair .
difference between getEndOffset() and getStartOffset() . |
|
|