Package org.eclipse.jface.text
Class TypedPosition
- java.lang.Object
-
- org.eclipse.jface.text.Position
-
- org.eclipse.jface.text.TypedPosition
-
public class TypedPosition extends Position
Convenience class for positions that have a type, similar toITypedRegion
.As
Position
,TypedPosition
can not be used as key in hash tables as it overridesequals
andhashCode
as it would be a value object.
-
-
Constructor Summary
Constructors Constructor Description TypedPosition(int offset, int length, String type)
Creates a position along the given specification.TypedPosition(ITypedRegion region)
Creates a position based on the typed region.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getType()
Returns the content type of the region.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
TypedPosition
public TypedPosition(int offset, int length, String type)
Creates a position along the given specification.- Parameters:
offset
- the offset of this positionlength
- the length of this positiontype
- the content type of this position
-
TypedPosition
public TypedPosition(ITypedRegion region)
Creates a position based on the typed region.- Parameters:
region
- the typed region
-
-
Method Detail
-
getType
public String getType()
Returns the content type of the region.- Returns:
- the content type of the region
-
-