|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.text.Position
org.eclipse.jface.text.link.LinkedPosition
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.
Field Summary |
Fields inherited from class org.eclipse.jface.text.Position |
isDeleted, length, offset |
Constructor Summary | |
LinkedPosition(IDocument document,
int offset,
int length)
Creates a new instance. |
|
LinkedPosition(IDocument document,
int offset,
int length,
int sequence)
Creates a new instance. |
Method Summary | |
boolean |
equals(Object other)
|
String |
getContent()
Returns the content of this position on the referenced document. |
IDocument |
getDocument()
|
int |
getSequenceNumber()
Returns the sequence number of this position. |
int |
hashCode()
|
boolean |
includes(DocumentEvent event)
Returns whether this position includes event . |
protected boolean |
includes(IDocument doc,
int off,
int len)
Returns whether this position includes the range given by offset and length . |
boolean |
includes(int pOffset)
Overrides Position.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. |
boolean |
includes(LinkedPosition position)
Returns whether this position includes position . |
boolean |
overlapsWith(LinkedPosition position)
Returns whether this position overlaps with position . |
void |
setSequenceNumber(int sequence)
Sets the sequence number of this position. |
Methods inherited from class org.eclipse.jface.text.Position |
delete, getLength, getOffset, isDeleted, overlapsWith, setLength, setOffset, undelete |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LinkedPosition(IDocument document, int offset, int length, int sequence)
document
- the documentoffset
- the offset of the positionlength
- the length of the positionsequence
- the iteration sequence rankpublic LinkedPosition(IDocument document, int offset, int length)
LinkedPosition(document, offset, length, LinkedPositionGroup.NO_STOP)
document
- the documentoffset
- the offset of the positionlength
- the length of the positionMethod Detail |
public IDocument getDocument()
public boolean equals(Object other)
equals
in class Position
public boolean overlapsWith(LinkedPosition position)
position
.
position
- the position to check.
true
if this position overlaps with
position
,false
otherwisepublic boolean includes(DocumentEvent event)
event
.
event
- the event to check.
true
if this position includes event
,
false
otherwisepublic boolean includes(LinkedPosition position)
position
.
position
- the position to check.
true
if this position includes
position
,false
otherwisepublic boolean includes(int pOffset)
Position.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.
includes
in class Position
pOffset
- the offset to check
true
if pOffset
is in
[offset, offset + length]
protected boolean includes(IDocument doc, int off, int len)
offset
and length
. A range is included by
a LinkedPosition
if includes(offset)
returns true for every offset in the range, including the borders of the
range.
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
true
if doc
is the same document as
this position refers to, and if the entire range is included in
this positionpublic String getContent() throws BadLocationException
BadLocationException
- if the position is not validpublic int getSequenceNumber()
public void setSequenceNumber(int sequence)
sequence
- the new sequence numberpublic int hashCode()
hashCode
in class Position
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.