public class DefaultTermOccurrence extends AbstractOccurrenceInText<Term> implements TermOccurrence
TermOccurrence
interface. It just
holds the term plus where it occurred.Modifier and Type | Field and Description |
---|---|
protected Term |
term
The term that occurred.
|
DEFAULT_LENGTH, DEFAULT_START, length, start
Constructor and Description |
---|
DefaultTermOccurrence()
Creates a new
DefaultTermOccurrence with default values. |
DefaultTermOccurrence(Term term,
int start,
int length)
Creates a new
DefaultTermOccurrence . |
Modifier and Type | Method and Description |
---|---|
Term |
asTerm()
Get the term for the object.
|
boolean |
equals(DefaultTermOccurrence other)
Determines if this
DefaultTermOccurrence equals a given
DefaultTermOccurrence . |
boolean |
equals(java.lang.Object other) |
Term |
getData()
Gets the data that occurred in the text.
|
Term |
getTerm()
Gets the term that occurred in the text.
|
int |
hashCode() |
void |
setTerm(Term term)
Sets the term that occurred.
|
getLength, getStart, setLength, setStart
clone
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getLength, getStart
protected Term term
public DefaultTermOccurrence()
DefaultTermOccurrence
with default values.public DefaultTermOccurrence(Term term, int start, int length)
DefaultTermOccurrence
.term
- The term that occurred.start
- The starting point of the occurrence in the source text.length
- The length of the occurrence in the source text.public Term asTerm()
Termable
public Term getData()
OccurrenceInText
getData
in interface OccurrenceInText<Term>
public Term getTerm()
TermOccurrence
getTerm
in interface TermOccurrence
public void setTerm(Term term)
term
- The term that occurred.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(DefaultTermOccurrence other)
DefaultTermOccurrence
equals a given
DefaultTermOccurrence
.other
- The other object.