public override bool IncrementToken() { if (ValSize == 0) { throw new Exception("call set???Value() before usage"); } // this will only clear all other attributes in this TokenStream ClearAttributes(); int shift = NumericAtt.IncShift(); TypeAtt.Type = (shift == 0) ? TOKEN_TYPE_FULL_PREC : TOKEN_TYPE_LOWER_PREC; PosIncrAtt.PositionIncrement = (shift == 0) ? 1 : 0; return(shift < ValSize); }
/// <summary> /// Initializes the token stream with the supplied <code>float</code> value. </summary> /// <param name="value"> the value, for which this TokenStream should enumerate tokens. </param> /// <returns> this instance, because of this you can use it the following way: /// <code>new Field(name, new NumericTokenStream(precisionStep).setFloatValue(value))</code> </returns> public NumericTokenStream SetFloatValue(float value) { NumericAtt.Init(NumericUtils.FloatToSortableInt(value), ValSize = 32, PrecisionStep_Renamed, -PrecisionStep_Renamed); return(this); }
/// <summary> /// Initializes the token stream with the supplied <code>int</code> value. </summary> /// <param name="value"> the value, for which this TokenStream should enumerate tokens. </param> /// <returns> this instance, because of this you can use it the following way: /// <code>new Field(name, new NumericTokenStream(precisionStep).setIntValue(value))</code> </returns> public NumericTokenStream SetIntValue(int value) { NumericAtt.Init(value, ValSize = 32, PrecisionStep_Renamed, -PrecisionStep_Renamed); return(this); }
/// <summary> /// Initializes the token stream with the supplied <code>double</code> value. </summary> /// <param name="value"> the value, for which this TokenStream should enumerate tokens. </param> /// <returns> this instance, because of this you can use it the following way: /// <code>new Field(name, new NumericTokenStream(precisionStep).setDoubleValue(value))</code> </returns> public NumericTokenStream SetDoubleValue(double value) { NumericAtt.Init(NumericUtils.DoubleToSortableLong(value), ValSize = 64, PrecisionStep_Renamed, -PrecisionStep_Renamed); return(this); }
/// <summary> /// Initializes the token stream with the supplied <code>long</code> value. </summary> /// <param name="value"> the value, for which this TokenStream should enumerate tokens. </param> /// <returns> this instance, because of this you can use it the following way: /// <code>new Field(name, new NumericTokenStream(precisionStep).setLongValue(value))</code> </returns> public NumericTokenStream SetLongValue(long value) { NumericAtt.Init(value, ValSize = 64, PrecisionStep_Renamed, -PrecisionStep_Renamed); return(this); }