Klasse SourceRange

java.lang.Object
org.aspectj.org.eclipse.jdt.core.SourceRange
Alle implementierten Schnittstellen:
ISourceRange

public final class SourceRange extends Object implements ISourceRange
A source range defines an element's source coordinates relative to its source buffer.
Seit:
3.6
Siehe auch:
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    SourceRange(int offset, int length)
    Instantiate a new source range using the given offset and the given length.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    boolean
     
    int
    Returns the number of characters of the source code for this element, relative to the source buffer in which this element is contained.
    int
    Returns the 0-based index of the first character of the source code for this element, relative to the source buffer in which this element is contained.
    int
     
    static boolean
    Helper method that answers whether a valid source range is available in the given ISourceRange.
     

    Von Klasse geerbte Methoden java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • SourceRange

      public SourceRange(int offset, int length)
      Instantiate a new source range using the given offset and the given length.
      Parameter:
      offset - the given offset
      length - the given length
  • Methodendetails

    • isAvailable

      public static boolean isAvailable(ISourceRange range)
      Helper method that answers whether a valid source range is available in the given ISourceRange. When an element has no associated source code, Java Model APIs may return either null or a range of [-1, 0] to indicate an invalid range. This utility method can be used to detect that case.
      Parameter:
      range - a source range, can be null
      Gibt zurück:
      true iff range is not null and range.getOffset() is not -1
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object
    • getLength

      public int getLength()
      Beschreibung aus Schnittstelle kopiert: ISourceRange
      Returns the number of characters of the source code for this element, relative to the source buffer in which this element is contained.
      Angegeben von:
      getLength in Schnittstelle ISourceRange
      Gibt zurück:
      the number of characters of the source code for this element, relative to the source buffer in which this element is contained
      Siehe auch:
    • getOffset

      public int getOffset()
      Beschreibung aus Schnittstelle kopiert: ISourceRange
      Returns the 0-based index of the first character of the source code for this element, relative to the source buffer in which this element is contained. However, if the element has no associated source code, an implementation may return -1.
      Angegeben von:
      getOffset in Schnittstelle ISourceRange
      Gibt zurück:
      the 0-based index of the first character of the source code for this element, relative to the source buffer in which this element is contained. However, if the element has no associated source code, an implementation may return -1.
      Siehe auch:
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object