Interface Span

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default int compareTo​(Span o)  
      default boolean encloses​(Span other)
      Returns true if the bounds of the other text do not extend outside the bounds of this text.
      int end()
      The ending offset
      default boolean isEmpty()
      Checks if the span is empty (start == end)
      int length()
      The length of the span
      static Span of​(int start, int end)
      Of span.
      default boolean overlaps​(Span other)
      Returns true if the bounds of other text are connected with the bounds of this text.
      int start()
      The starting offset
    • Method Detail

      • of

        static Span of​(int start,
                       int end)
        Of span.
        Parameters:
        start - the start
        end - the end
        Returns:
        the span
      • encloses

        default boolean encloses​(Span other)
        Returns true if the bounds of the other text do not extend outside the bounds of this text.
        Parameters:
        other - The other text to check if this one encloses
        Returns:
        True if the two texts are in the same document and this text encloses the other, False otherwise
      • end

        int end()
        The ending offset
        Returns:
        The ending offset (exclusive).
      • isEmpty

        default boolean isEmpty()
        Checks if the span is empty (start == end)
        Returns:
        True if the span is empty, False if not
      • length

        int length()
        The length of the span
        Returns:
        The length of the span
      • overlaps

        default boolean overlaps​(Span other)
        Returns true if the bounds of other text are connected with the bounds of this text.
        Parameters:
        other - The other text to check if this one overlaps
        Returns:
        True if the two texts are in the same document and overlap, False otherwise
      • start

        int start()
        The starting offset
        Returns:
        The start offset (inclusive).