public final class Term
extends java.lang.Object
implements java.lang.Comparable, 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(java.lang.Object other) |
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 o)
Compares two terms, returning true iff they have the same
field and text.
|
java.lang.String |
field()
Returns the field of this term, an interned string.
|
int |
hashCode()
Combines the hashCode() of the field and the text.
|
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 final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
public final int compareTo(Term other)
public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.