|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.ie.machinereading.structure.Span
public class Span
Stores the offsets for a span of text Offsets may indicate either token or byte positions Start is inclusive, end is exclusive
| Constructor Summary | |
|---|---|
Span(int s,
int e)
This assumes that s <= e. |
|
Span(Span... spans)
Creates a span that encloses all spans in the argument list. |
|
| Method Summary | |
|---|---|
boolean |
contains(int i)
Returns true if i is inside this span. |
boolean |
contains(Span otherSpan)
Returns true if this span contains otherSpan. |
int |
end()
|
boolean |
equals(java.lang.Object other)
|
void |
expandToInclude(Span otherSpan)
|
static Span |
fromValues(int val1,
int val2)
Safe way to construct Spans if you're not sure which value is higher. |
int |
hashCode()
|
boolean |
isAfter(Span otherSpan)
Returns true if this span starts after the otherSpan's end. |
boolean |
isBefore(Span otherSpan)
Returns true if this span ends before the otherSpan starts. |
void |
setEnd(int e)
|
void |
setStart(int s)
|
int |
start()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Span(int s,
int e)
public Span(Span... spans)
| Method Detail |
|---|
public static Span fromValues(int val1,
int val2)
public int start()
public int end()
public void setStart(int s)
public void setEnd(int e)
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic void expandToInclude(Span otherSpan)
public boolean contains(Span otherSpan)
public boolean contains(int i)
public boolean isBefore(Span otherSpan)
java.lang.IllegalArgumentException - if either span contains the other spanpublic boolean isAfter(Span otherSpan)
java.lang.IllegalArgumentException - if either span contains the other span
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||