edu.upenn.cis.pdtb
Class Span

java.lang.Object
  extended byedu.upenn.cis.pdtb.Span

public class Span
extends java.lang.Object

Vanilla spans. Added various predicates.

Since:
0.1
Version:
3 Added a method for crossing comparison., 2 Added comparison methods.
Author:
nikhild

Constructor Summary
Span(int start, int end)
           
Span(java.lang.String s)
          Creates a new instance of Span
 
Method Summary
 boolean contains(Span s2)
          Equivalent to start <= start2 && end2 <= end.
 boolean crosses(Span s2)
          Equivalent to (start < start2 && start2 < end && end2 > end) || (start2 < start && start < end2 && end > end2)
 boolean equals(java.lang.Object o)
           
 int getEnd()
           
 int getStart()
           
 boolean isContainedBy(Span s2)
          Equivalent to start2 <= start && end <= end2.
 boolean isOverlapping(Span s2)
          Equivalent to (start >= start2 && start < end2) || (start2 >= start && start2 < end).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Span

public Span(java.lang.String s)
Creates a new instance of Span


Span

public Span(int start,
            int end)
Method Detail

getStart

public int getStart()

getEnd

public int getEnd()

contains

public boolean contains(Span s2)
Equivalent to start <= start2 && end2 <= end.


isContainedBy

public boolean isContainedBy(Span s2)
Equivalent to start2 <= start && end <= end2.


isOverlapping

public boolean isOverlapping(Span s2)
Equivalent to (start >= start2 && start < end2) || (start2 >= start && start2 < end).


crosses

public boolean crosses(Span s2)
Equivalent to (start < start2 && start2 < end && end2 > end) || (start2 < start && start < end2 && end > end2)


toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object o)