org.apache.lucene.index
public final class Term extends Object implements Comparable, Serializable
Constructor and Description |
---|
Term(String fld,
String txt)
Constructs a Term with the given field and text.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(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(String text)
Optimized construction of new Terms by reusing same field as this Term
- avoids field.intern() overhead
|
boolean |
equals(Object o)
Compares two terms, returning true iff they have the same
field and text.
|
String |
field()
Returns the field of this term, an interned string.
|
int |
hashCode()
Combines the hashCode() of the field and the text.
|
String |
text()
Returns the text of this term.
|
String |
toString() |
public final String field()
public final String text()
public Term createTerm(String text)
text
- The text of the new term (field is implicitly same as this Term instance)public final boolean equals(Object o)
public final int hashCode()
public int compareTo(Object other)
compareTo
in interface Comparable
public final int compareTo(Term other)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.