pivot.wtk
Class SpanSequence.SpanComparator

java.lang.Object
  extended by pivot.wtk.SpanSequence.SpanComparator
All Implemented Interfaces:
Comparator<Span>
Enclosing class:
SpanSequence

public static class SpanSequence.SpanComparator
extends Object
implements Comparator<Span>

Determines the relative order of two spans.

Author:
gbrown

Constructor Summary
SpanSequence.SpanComparator()
           
 
Method Summary
 int compare(Span span1, Span span2)
          Compares two span values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SpanSequence.SpanComparator

public SpanSequence.SpanComparator()
Method Detail

compare

public int compare(Span span1,
                   Span span2)
Compares two span values. A span is considered less than or greater than another span if and only if it is absolutely less than or greater than the other span; if the spans intersect in any way, they are considered equal.

Specified by:
compare in interface Comparator<Span>
Returns:
A positive value if span1 is greater than span2; a negative value if span1 is less than span2; a value of zero if span1 intersects with span2.