Class ContentInterval


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public class ContentInterval
    extends java.lang.Object
    A content interval containing the inclusive start offset and exclusive end offset.
    Since:
    14
    • Constructor Summary

      Constructors 
      Constructor Description
      ContentInterval​(int startOffset, int endOffset)
      Constructor.
    • Constructor Detail

      • ContentInterval

        public ContentInterval​(int startOffset,
                               int endOffset)
        Constructor.
        Parameters:
        startOffset - Interval inclusive start offset.
        endOffset - Interval exclusive end offset.
    • Method Detail

      • getStartOffset

        public int getStartOffset()
        Returns:
        Returns the content interval inclusive start offset.
      • getEndOffset

        public int getEndOffset()
        Returns:
        Returns the content interval exclusive end offset.
      • getLength

        public int getLength()
        Returns:
        The length of the interval.
        Since:
        24
      • contains

        public boolean contains​(int offset)
        Checks whether the interval contains the given offset.
        Parameters:
        offset - An offset.
        Returns:
        true if the offset is contained in the interval.
        Since:
        24
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()