java.lang.Object
org.apache.uima.caseditor.editor.util.Span
All Implemented Interfaces:
Comparable<Span>

public class Span extends Object implements Comparable<Span>
This class usually specifies an continous are of text. This area has an start and end index. The difference of the end and start is the length of the area.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Span(int start, int length)
    Initializes a new Span instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares the current instance to another Span object.
    boolean
    Tests if the current instance is equal to o;.
    int
    Returns the end index.
    int
    Returns the length.
    int
    Returns the start index.
    int
    Generates a hash code of the current object.
    boolean
    isContaining(Span containingSpan)
    Returns true if the given span is a subset of this span.
    boolean
    Checks if is intersecting.
    Represents the current object as a String.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Span

      public Span(int start, int length)
      Initializes a new Span instance.
      Parameters:
      start - the start
      length - the length
  • Method Details

    • getStart

      public int getStart()
      Returns the start index.
      Returns:
      - start index
    • getLength

      public int getLength()
      Returns the length.
      Returns:
      - length
    • getEnd

      public int getEnd()
      Returns the end index.
      Returns:
      - end index
    • isContaining

      public boolean isContaining(Span containingSpan)
      Returns true if the given span is a subset of this span.
      Parameters:
      containingSpan - - the span to compare
      Returns:
      - true if containingSpan is a subset.
    • isIntersecting

      public boolean isIntersecting(Span s)
      Checks if is intersecting.
      Parameters:
      s - the s
      Returns:
      true, if is intersecting
    • compareTo

      public int compareTo(Span span)
      Compares the current instance to another Span object.
      Specified by:
      compareTo in interface Comparable<Span>
      Parameters:
      span - the span
      Returns:
      the int
    • equals

      public boolean equals(Object o)
      Tests if the current instance is equal to o;.
      Overrides:
      equals in class Object
      Parameters:
      o - the o
      Returns:
      true, if successful
    • toString

      public String toString()
      Represents the current object as a String.
      Overrides:
      toString in class Object
      Returns:
      the string
    • hashCode

      public int hashCode()
      Generates a hash code of the current object.
      Overrides:
      hashCode in class Object
      Returns:
      the int