public class Span extends Object implements Comparable
| Constructor and Description |
|---|
Span(int s,
int e)
Creates a span from position s up to position e,
with a null document pointer.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object o)
compares this Span to Object o, which must be a Span.
|
Document |
document()
Returns the Document associated with a Span.
|
int |
end()
Returns the end of the span.
|
int |
endNoWS(Document doc)
Returns the end of the span, after trimming any white space at the
end of the span.
|
boolean |
equals(Object o)
Returns true if the start and end of the spans are both equal.
|
int |
hashCode()
Returns a hashcode which is a function of the start and end values
(so that, as required for hashing, equal spans have equal hashCodes.
|
void |
setDocument(Document doc)
Sets the Document associated with a Span.
|
void |
setEnd(int e)
sets the end of the span to 's'.
|
void |
setStart(int s)
sets the start of the span to 's'.
|
int |
start()
Returns the start of the span.
|
String |
toString()
Returns a printable form of the span, "[start-end]".
|
boolean |
within(Span s)
Returns true if Span 's' contains the span.
|
public Span(int s,
int e)
public int start()
public int end()
public void setStart(int s)
public void setEnd(int e)
public int endNoWS(Document doc)
public void setDocument(Document doc)
public Document document()
public boolean equals(Object o)
public int hashCode()
public boolean within(Span s)
public int compareTo(Object o)
compareTo in interface ComparableCopyright © 2016 New York University. All rights reserved.