edu.upenn.cis.pdtb.util
Class SpanList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractSet
          extended byedu.upenn.cis.pdtb.util.ArraySet
              extended byedu.upenn.cis.pdtb.util.SpanList
All Implemented Interfaces:
java.util.Collection, java.util.Set, java.util.SortedSet

public class SpanList
extends ArraySet

Spans ordered by getStart() and getEnd(). This has been changed to derive from ArraySet rather than TreeSet for performance reasons. Since the SortedSet interface is still respected, hopefully this won't cause any problems.

Since:
0.1
Version:
3 Added a method for crossing comparison., 2 Added several comparison methods. Derives from ArraySet rather than TreeSet.
Author:
nikhild

Field Summary
 
Fields inherited from class edu.upenn.cis.pdtb.util.ArraySet
fCheckLowerBound, fCheckUpperBound, fComparator, fLowerBound, fStore, fUpperBound
 
Constructor Summary
SpanList()
           
SpanList(java.lang.String spans)
          Creates a new instance of SpanList
 
Method Summary
 int getRangeEnd()
           
 int getRangeStart()
           
 boolean isContainedBy(Span s2)
          Checks if every span in this set is contained by s2.
 boolean isContainedBy(SpanList l)
          Checks if every span in this set is contained by some span in l.
 boolean isIdentical(Span s2)
          Checks if every span in this set is identical to s2.
 boolean isIdentical(SpanList l)
          Checks if every span in this set is identical to some span in l and conversely.
 boolean isOverlapping(Span s2)
          Checks if some span in this set overlaps with s2.
 boolean isOverlapping(SpanList l)
          Checks if some span in this set overlaps with some span in l.
 boolean isRangedOverBy(Span s)
          Checks if the range of this set is contained by s.
 boolean isRangedOverBy(SpanList l)
          Checks if the range of this set is contained by the range of l.
 Span range()
          The range of this set.
 boolean rangeCrosses(Span s)
          Checks if the range of this set crosses s.
 boolean rangeCrosses(SpanList l)
          Checks if the range of this set crosses the range of l.
 boolean rangeOverlaps(Span s)
           
 boolean rangeOverlaps(SpanList l)
           
 boolean rangesOver(Span s)
          Checks if the range of this set is contains s.
 boolean rangesOver(SpanList l)
          Checks if the range of this set is contains the range of l.
 java.lang.String toString()
           
 
Methods inherited from class edu.upenn.cis.pdtb.util.ArraySet
add, clear, comparator, contains, findLeastUpperBound, first, get, headSet, iterator, last, main, remove, search, size, subSet, tailSet
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

SpanList

public SpanList(java.lang.String spans)
Creates a new instance of SpanList


SpanList

public SpanList()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class ArraySet

isOverlapping

public boolean isOverlapping(SpanList l)
Checks if some span in this set overlaps with some span in l.


isOverlapping

public boolean isOverlapping(Span s2)
Checks if some span in this set overlaps with s2.


isContainedBy

public boolean isContainedBy(SpanList l)
Checks if every span in this set is contained by some span in l.


isContainedBy

public boolean isContainedBy(Span s2)
Checks if every span in this set is contained by s2.


isIdentical

public boolean isIdentical(SpanList l)
Checks if every span in this set is identical to some span in l and conversely.


isIdentical

public boolean isIdentical(Span s2)
Checks if every span in this set is identical to s2.


rangesOver

public boolean rangesOver(SpanList l)
Checks if the range of this set is contains the range of l.


rangesOver

public boolean rangesOver(Span s)
Checks if the range of this set is contains s.


isRangedOverBy

public boolean isRangedOverBy(SpanList l)
Checks if the range of this set is contained by the range of l.


isRangedOverBy

public boolean isRangedOverBy(Span s)
Checks if the range of this set is contained by s.


rangeCrosses

public boolean rangeCrosses(SpanList l)
Checks if the range of this set crosses the range of l.


rangeCrosses

public boolean rangeCrosses(Span s)
Checks if the range of this set crosses s.


rangeOverlaps

public boolean rangeOverlaps(SpanList l)

rangeOverlaps

public boolean rangeOverlaps(Span s)

range

public Span range()
The range of this set. This is a span starting at the start of the first element and ending at the end of the last element.


getRangeStart

public int getRangeStart()

getRangeEnd

public int getRangeEnd()