The NumericUtils type exposes the following members.

Methods

  NameDescription
Public methodStatic memberDoubleToPrefixCoded
Convenience method: this just returns: longToPrefixCoded(doubleToSortableLong(val))
Public methodStatic memberDoubleToSortableLong
Converts a
CopyC#
double
value to a sortable signed
CopyC#
long
. The value is converted by getting their IEEE 754 floating-point "double format" bit layout and then some bits are swapped, to be able to compare the result as long. By this the precision is not reduced, but the value can easily used as a long.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberFloatToPrefixCoded
Convenience method: this just returns: intToPrefixCoded(floatToSortableInt(val))
Public methodStatic memberFloatToSortableInt
Converts a
CopyC#
float
value to a sortable signed
CopyC#
int
. The value is converted by getting their IEEE 754 floating-point "float format" bit layout and then some bits are swapped, to be able to compare the result as int. By this the precision is not reduced, but the value can easily used as an int.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIntToPrefixCoded(Int32)
This is a convenience method, that returns prefix coded bits of an int without reducing the precision. It can be used to store the full precision value as a stored field in index.

To decode, use {@link #prefixCodedToInt}.

Public methodStatic memberIntToPrefixCoded(Int32, Int32)
Expert: Returns prefix coded bits after reducing the precision by
CopyC#
shift
bits. This is method is used by {@link IntRangeBuilder}.
Public methodStatic memberIntToPrefixCoded(Int32, Int32, array<Char>[]()[][])
Expert: Returns prefix coded bits after reducing the precision by
CopyC#
shift
bits. This is method is used by {@link NumericTokenStream}.
Public methodStatic memberLongToPrefixCoded(Int64)
This is a convenience method, that returns prefix coded bits of a long without reducing the precision. It can be used to store the full precision value as a stored field in index.

To decode, use {@link #prefixCodedToLong}.

Public methodStatic memberLongToPrefixCoded(Int64, Int32)
Expert: Returns prefix coded bits after reducing the precision by
CopyC#
shift
bits. This is method is used by {@link LongRangeBuilder}.
Public methodStatic memberLongToPrefixCoded(Int64, Int32, array<Char>[]()[][])
Expert: Returns prefix coded bits after reducing the precision by
CopyC#
shift
bits. This is method is used by {@link NumericTokenStream}.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberPrefixCodedToDouble
Convenience method: this just returns: sortableLongToDouble(prefixCodedToLong(val))
Public methodStatic memberPrefixCodedToFloat
Convenience method: this just returns: sortableIntToFloat(prefixCodedToInt(val))
Public methodStatic memberPrefixCodedToInt
Returns an int from prefixCoded characters. Rightmost bits will be zero for lower precision codes. This method can be used to decode e.g. a stored field.
Public methodStatic memberPrefixCodedToLong
Returns a long from prefixCoded characters. Rightmost bits will be zero for lower precision codes. This method can be used to decode e.g. a stored field.
Public methodStatic memberSortableIntToFloat
Converts a sortable
CopyC#
int
back to a
CopyC#
float
.
Public methodStatic memberSortableLongToDouble
Converts a sortable
CopyC#
long
back to a
CopyC#
double
.
Public methodStatic memberSplitIntRange
Expert: Splits an int range recursively. You may implement a builder that adds clauses to a {@link Lucene.Net.Search.BooleanQuery} for each call to its {@link IntRangeBuilder#AddRange(String,String)} method.

This method is used by {@link NumericRangeQuery}.

Public methodStatic memberSplitLongRange
Expert: Splits a long range recursively. You may implement a builder that adds clauses to a {@link Lucene.Net.Search.BooleanQuery} for each call to its {@link LongRangeBuilder#AddRange(String,String)} method.

This method is used by {@link NumericRangeQuery}.

Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)

Fields

  NameDescription
Public fieldStatic memberBUF_SIZE_INT
Expert: The maximum term length (used for
CopyC#
char[]
buffer size) for encoding
CopyC#
int
values.
Public fieldStatic memberBUF_SIZE_LONG
Expert: The maximum term length (used for
CopyC#
char[]
buffer size) for encoding
CopyC#
long
values.
Public fieldStatic memberPRECISION_STEP_DEFAULT
The default precision step used by {@link NumericField}, {@link NumericTokenStream}, {@link NumericRangeQuery}, and {@link NumericRangeFilter} as default
Public fieldStatic memberSHIFT_START_INT
Expert: Integers are stored at lower precision by shifting off lower bits. The shift count is stored as
CopyC#
SHIFT_START_INT+shift
in the first character
Public fieldStatic memberSHIFT_START_LONG
Expert: Longs are stored at lower precision by shifting off lower bits. The shift count is stored as
CopyC#
SHIFT_START_LONG+shift
in the first character

See Also