コード例 #1
0
ファイル: Span.java プロジェクト: happybelly/factify
  /** 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;
  }
コード例 #2
0
ファイル: Span.java プロジェクト: happybelly/factify
 /**
  * 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());
 }