public class Span extends java.lang.Object implements java.lang.Comparable<Span>, java.io.Serializable
Constructor and Description |
---|
Span(int begin,
int end)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Span that)
A span precedes another one if the former's beginning precedes the latter's, or the former's
end precedes the latter's if the former's beginning is equal to the latter's.
|
boolean |
coveredBy(Span that)
Returns true if this span is covered by the given span completely.
|
boolean |
covers(Span that)
Returns true if this span covers the given span completely.
|
boolean |
equals(java.lang.Object obj) |
int |
getBegin() |
int |
getEnd() |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
overlap(Span that)
Returns if this span overlaps the given span to some degree.
|
java.lang.String |
toString() |
public Span(int begin, int end)
begin
- end
- public boolean isEmpty()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean covers(Span that)
that
- public boolean coveredBy(Span that)
that
- public boolean overlap(Span that)
that
- public int compareTo(Span that)
compareTo
in interface java.lang.Comparable<Span>
that
- public int getBegin()
public int getEnd()