public static final class LegacyNumericTokenStream.LegacyNumericTermAttributeImpl extends AttributeImpl implements LegacyNumericTokenStream.LegacyNumericTermAttribute, TermToBytesRefAttribute
LegacyNumericTokenStream.LegacyNumericTermAttribute
.Modifier and Type | Field and Description |
---|---|
private BytesRefBuilder |
bytes |
private int |
precisionStep |
private int |
shift |
private long |
value |
private int |
valueSize |
Constructor and Description |
---|
LegacyNumericTermAttributeImpl()
Creates, but does not yet initialize this attribute instance
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the values in this AttributeImpl and resets it to its
default value.
|
LegacyNumericTokenStream.LegacyNumericTermAttributeImpl |
clone()
In most cases the clone is, and should be, deep in order to be able to
properly capture the state of all attributes.
|
void |
copyTo(AttributeImpl target)
Copies the values from this Attribute into the passed-in
target attribute.
|
boolean |
equals(java.lang.Object obj) |
BytesRef |
getBytesRef()
Retrieve this attribute's BytesRef.
|
long |
getRawValue()
Returns current token's raw value as
long with all LegacyNumericTokenStream.LegacyNumericTermAttribute.getShift() applied, undefined before first token |
int |
getShift()
Returns current shift value, undefined before first token
|
int |
getValueSize()
Returns value size in bits (32 for
float , int ; 64 for double , long ) |
int |
hashCode() |
int |
incShift()
Don't call this method!
|
void |
init(long value,
int valueSize,
int precisionStep,
int shift)
Don't call this method!
|
void |
reflectWith(AttributeReflector reflector)
This method is for introspection of attributes, it should simply
add the key/values this attribute holds to the given
AttributeReflector . |
void |
setShift(int shift)
Don't call this method!
|
reflectAsString
private long value
private int valueSize
private int shift
private int precisionStep
private BytesRefBuilder bytes
public LegacyNumericTermAttributeImpl()
init(long, int, int, int)
public BytesRef getBytesRef()
TermToBytesRefAttribute
getBytesRef
in interface TermToBytesRefAttribute
public int getShift()
LegacyNumericTokenStream.LegacyNumericTermAttribute
getShift
in interface LegacyNumericTokenStream.LegacyNumericTermAttribute
public void setShift(int shift)
LegacyNumericTokenStream.LegacyNumericTermAttribute
setShift
in interface LegacyNumericTokenStream.LegacyNumericTermAttribute
public int incShift()
LegacyNumericTokenStream.LegacyNumericTermAttribute
incShift
in interface LegacyNumericTokenStream.LegacyNumericTermAttribute
public long getRawValue()
LegacyNumericTokenStream.LegacyNumericTermAttribute
long
with all LegacyNumericTokenStream.LegacyNumericTermAttribute.getShift()
applied, undefined before first tokengetRawValue
in interface LegacyNumericTokenStream.LegacyNumericTermAttribute
public int getValueSize()
LegacyNumericTokenStream.LegacyNumericTermAttribute
float
, int
; 64 for double
, long
)getValueSize
in interface LegacyNumericTokenStream.LegacyNumericTermAttribute
public void init(long value, int valueSize, int precisionStep, int shift)
LegacyNumericTokenStream.LegacyNumericTermAttribute
init
in interface LegacyNumericTokenStream.LegacyNumericTermAttribute
public void clear()
AttributeImpl
clear
in class AttributeImpl
public void reflectWith(AttributeReflector reflector)
AttributeImpl
AttributeReflector
.
Implementations look like this (e.g. for a combined attribute implementation):
public void reflectWith(AttributeReflector reflector) { reflector.reflect(CharTermAttribute.class, "term", term()); reflector.reflect(PositionIncrementAttribute.class, "positionIncrement", getPositionIncrement()); }
If you implement this method, make sure that for each invocation, the same set of Attribute
interfaces and keys are passed to AttributeReflector.reflect(java.lang.Class<? extends org.apache.lucene.util.Attribute>, java.lang.String, java.lang.Object)
in the same order, but possibly
different values. So don't automatically exclude e.g. null
properties!
reflectWith
in class AttributeImpl
AttributeImpl.reflectAsString(boolean)
public void copyTo(AttributeImpl target)
AttributeImpl
copyTo
in class AttributeImpl
public LegacyNumericTokenStream.LegacyNumericTermAttributeImpl clone()
AttributeImpl
clone
in class AttributeImpl
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object