Class 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 Detail

      • 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 Detail

      • getType

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