public final class Term extends java.lang.Object implements java.lang.Comparable<Term>, java.io.Serializable
| Constructor and Description |
|---|
Term(java.lang.String fld)
Constructs a Term with the given field and empty text.
|
Term(java.lang.String fld,
java.lang.String txt)
Constructs a Term with the given field and text.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Term other)
Compares two terms, returning a negative integer if this
term belongs before the argument, zero if this term is equal to the
argument, and a positive integer if this term belongs after the argument.
|
Term |
createTerm(java.lang.String text)
Optimized construction of new Terms by reusing same field as this Term
- avoids field.intern() overhead
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
field()
Returns the field of this term, an interned string.
|
int |
hashCode() |
java.lang.String |
text()
Returns the text of this term.
|
java.lang.String |
toString() |
public Term(java.lang.String fld,
java.lang.String txt)
Note that a null field or null text value results in undefined behavior for most Lucene APIs that accept a Term parameter.
public Term(java.lang.String fld)
fld - public final java.lang.String field()
public final java.lang.String text()
public Term createTerm(java.lang.String text)
text - The text of the new term (field is implicitly same as this Term instance)public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic final int compareTo(Term other)
compareTo in interface java.lang.Comparable<Term>public final java.lang.String toString()
toString in class java.lang.Object