Class StringMatcher.Position

java.lang.Object
org.eclipse.core.text.StringMatcher.Position
Enclosing class:
StringMatcher

public static final class StringMatcher.Position extends Object
Start and end positions of a shortest match found by StringMatcher.find(String, int, int).

Note that find() returns null if there is no match, so the start and end indices are always non-negative.

  • Constructor Details

    • Position

      public Position(int start, int end)
      Creates a new StringMatcher.Position.
      Parameters:
      start - index of first matched character
      end - index after the last matched character
  • Method Details

    • getStart

      public int getStart()
      Retrieves the index of the first matched character.
      Returns:
      the index of the first matched character
    • getEnd

      public int getEnd()
      Retrieves the index after the last matched character.
      Returns:
      the index after the last matched character
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object