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 to ITypedRegion.

As Position,TypedPosition can not be used as key in hash tables as it overrides equals and hashCode as it would be a value object.

  • Constructor Details

    • TypedPosition

      public TypedPosition(int offset, int length, String type)
      Creates a position along the given specification.
      Parameters:
      offset - the offset of this position
      length - the length of this position
      type - 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 Details

    • getType

      public String getType()
      Returns the content type of the region.
      Returns:
      the content type of the region
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Position
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Position
    • toString

      public String toString()
      Overrides:
      toString in class Position