Package org.eclipse.jface.text.link
Class LinkedPosition
java.lang.Object
org.eclipse.jface.text.Position
org.eclipse.jface.text.link.LinkedPosition
- Direct Known Subclasses:
- ProposalPosition
A 
Position on a document that knows which document it is
 registered with and has a sequence number for tab stops.
 Clients may extend this class.
- Since:
- 3.0
- 
Field Summary
- 
Constructor SummaryConstructorsConstructorDescriptionLinkedPosition(IDocument document, int offset, int length) Creates a new instance.LinkedPosition(IDocument document, int offset, int length, int sequence) Creates a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns the content of this position on the referenced document.intReturns the sequence number of this position.inthashCode()booleanincludes(int pOffset) OverridesPosition.includes(int)so every offset is considered included that lies in between the first and last offset of this position, and offsets that are right at the end of the position.booleanincludes(DocumentEvent event) Returns whether this position includesevent.protected booleanReturns whether this position includes the range given byoffsetandlength.booleanincludes(LinkedPosition position) Returns whether this position includesposition.booleanoverlapsWith(LinkedPosition position) Returns whether this position overlaps withposition.voidsetSequenceNumber(int sequence) Sets the sequence number of this position.
- 
Constructor Details- 
LinkedPositionCreates a new instance.- Parameters:
- document- the document
- offset- the offset of the position
- length- the length of the position
- sequence- the iteration sequence rank
 
- 
LinkedPositionCreates a new instance. Equivalent to callingLinkedPosition(document, offset, length, LinkedPositionGroup.NO_STOP)- Parameters:
- document- the document
- offset- the offset of the position
- length- the length of the position
 
 
- 
- 
Method Details- 
getDocument- Returns:
- Returns the document.
 
- 
equals
- 
overlapsWithReturns whether this position overlaps withposition.- Parameters:
- position- the position to check.
- Returns:
- trueif this position overlaps with- position,- falseotherwise
 
- 
includesReturns whether this position includesevent.- Parameters:
- event- the event to check.
- Returns:
- trueif this position includes- event,- falseotherwise
 
- 
includesReturns whether this position includesposition.- Parameters:
- position- the position to check.
- Returns:
- trueif this position includes- position,- falseotherwise
 
- 
includespublic boolean includes(int pOffset) OverridesPosition.includes(int)so every offset is considered included that lies in between the first and last offset of this position, and offsets that are right at the end of the position.
- 
includesReturns whether this position includes the range given byoffsetandlength. A range is included by aLinkedPositionifincludes(offset)returns true for every offset in the range, including the borders of the range.- Parameters:
- doc- the document that the given range refers to, may be- null
- off- the offset of the range, referring to- document
- len- the length of the range
- Returns:
- trueif- docis the same document as this position refers to, and if the entire range is included in this position
 
- 
getContentReturns the content of this position on the referenced document.- Returns:
- the content of the document at this position
- Throws:
- BadLocationException- if the position is not valid
 
- 
getSequenceNumberpublic int getSequenceNumber()Returns the sequence number of this position.- Returns:
- the sequence number of this position
 
- 
setSequenceNumberpublic void setSequenceNumber(int sequence) Sets the sequence number of this position.- Parameters:
- sequence- the new sequence number
 
- 
hashCodepublic int hashCode()
 
-