|
org.netbeans.modules.editor.util/1 1.17 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.lib.editor.util.swing.PositionRegion
public class PositionRegion
A pair of positions delimiting a text region in a swing document.
At all times it should be satisfied that
getStartOffset()
<= getEndOffset()
.
Constructor Summary | |
---|---|
PositionRegion(Document doc,
int startOffset,
int endOffset)
Construct new position region based on the knowledge of the document and starting and ending offset. |
|
PositionRegion(Position startPosition,
Position endPosition)
Construct new position region. |
Method Summary | |
---|---|
static Position |
createFixedPosition(int offset)
Create a fixed position instance that just wraps a given integer offset. |
static Comparator<PositionRegion> |
getComparator()
Get comparator for position regions comparing start offsets of the two given regions. |
int |
getEndOffset()
Get ending offset of this region. |
Position |
getEndPosition()
Get ending position of this region. |
int |
getLength()
Get length of this region. |
int |
getStartOffset()
Get starting offset of this region. |
Position |
getStartPosition()
Get starting position of this region. |
static boolean |
isRegionsSorted(List<PositionRegion> positionRegionList)
Check whether a list of position regions is sorted according the start offsets of the regions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PositionRegion(Position startPosition, Position endPosition)
startPosition
- non-null start position of the region <= end position.endPosition
- non-null end position of the region >= start position.public PositionRegion(Document doc, int startOffset, int endOffset) throws BadLocationException
BadLocationException
Method Detail |
---|
public static final Comparator<PositionRegion> getComparator()
public static Position createFixedPosition(int offset)
offset
- >=0 offset at which the position should be created.public static boolean isRegionsSorted(List<PositionRegion> positionRegionList)
positionRegionList
- list of the regions to be compared.
public final int getStartOffset()
public final Position getStartPosition()
public final int getEndOffset()
public final Position getEndPosition()
public final int getLength()
getEndOffset() - getStartOffset()
.
|
org.netbeans.modules.editor.util/1 1.17 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |