public final class Term extends Object implements Comparable<Term>, Accountable
NULL_ACCOUNTABLE
Constructor and Description |
---|
Term(String fld)
Constructs a Term with the given field and empty text.
|
Term(String fld,
BytesRef bytes)
Constructs a Term with the given field and bytes.
|
Term(String fld,
BytesRefBuilder bytesBuilder)
Constructs a Term with the given field and the bytes from a builder.
|
Term(String fld,
String text)
Constructs a Term with the given field and text.
|
Modifier and Type | Method and Description |
---|---|
BytesRef |
bytes()
Returns the bytes of this term, these should not be modified.
|
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.
|
boolean |
equals(Object obj) |
String |
field()
Returns the field of this term.
|
int |
hashCode() |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
String |
text()
Returns the text of this term.
|
String |
toString() |
static String |
toString(BytesRef termText)
Returns human-readable form of the term text.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildResources
public Term(String fld, BytesRef bytes)
Note that a null field or null bytes value results in undefined behavior for most Lucene APIs that accept a Term parameter.
The provided BytesRef is copied when it is non null.
public Term(String fld, BytesRefBuilder bytesBuilder)
Note that a null field value results in undefined behavior for most Lucene APIs that accept a Term parameter.
public Term(String fld, String text)
Note that a null field or null text value results in undefined behavior for most Lucene APIs that accept a Term parameter.
public Term(String fld)
fld
- field's namepublic final String field()
public final String text()
public static final String toString(BytesRef termText)
public final BytesRef bytes()
public final int compareTo(Term other)
compareTo
in interface Comparable<Term>
public long ramBytesUsed()
Accountable
ramBytesUsed
in interface Accountable
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.