Exemplo n.º 1
0
  /** Checks if the specified span is equal to the current span. */
  public boolean equals(Object o) {

    boolean result;

    if (o == this) {
      result = true;
    } else if (o instanceof Span) {
      Span s = (Span) o;

      result =
          (getStart() == s.getStart())
              && (getEnd() == s.getEnd())
              && (getType() != null ? type.equals(s.getType()) : true);
    } else {
      result = false;
    }

    return result;
  }
Exemplo n.º 2
0
 /**
  * Initializes a new Span object with an existing Span which is shifted by an offset.
  *
  * @param span
  * @param offset
  */
 public Span(Span span, int offset) {
   this(span.start + offset, span.end + offset, span.getType());
 }