Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Static Public Member Functions | Static Public Attributes | List of all members
Lucene.Net.Documents.NumberTools Class Reference

Provides support for converting longs to Strings, and back again. The strings are structured so that lexicographic sorting order is preserved. More...

Static Public Member Functions

static System.String LongToString (long l)
 Converts a long to a String suitable for indexing.
 
static long StringToLong (System.String str)
 Converts a String that was returned by LongToString back to a long.
 
static System.String ToString (long lval)
 
static long ToLong (System.String t)
 

Static Public Attributes

static readonly System.String MIN_STRING_VALUE = NEGATIVE_PREFIX + "0000000000000"
 Equivalent to longToString(Long.MIN_VALUE)
 
static readonly System.String MAX_STRING_VALUE = POSITIVE_PREFIX + "1y2p0ij32e8e7"
 Equivalent to longToString(Long.MAX_VALUE)
 
static readonly int STR_SIZE = MIN_STRING_VALUE.Length
 The length of (all) strings returned by LongToString
 

Detailed Description

Provides support for converting longs to Strings, and back again. The strings are structured so that lexicographic sorting order is preserved.

That is, if l1 is less than l2 for any two longs l1 and l2, then NumberTools.longToString(l1) is lexicographically less than NumberTools.longToString(l2). (Similarly for "greater than" and "equals".)

This class handles all long values (unlike Lucene.Net.Documents.DateField).

<deprecated> For new indexes use NumericUtils instead, which provides a sortable binary representation (prefix encoded) of numeric values. To index and efficiently query numeric values use NumericField and NumericRangeQuery{T}. This class is included for use with existing indices and will be removed in a future release (possibly Lucene 4.0). </deprecated>

Definition at line 49 of file NumberTools.cs.

Member Function Documentation

static System.String Lucene.Net.Documents.NumberTools.LongToString ( long  l)
static

Converts a long to a String suitable for indexing.

Definition at line 78 of file NumberTools.cs.

static long Lucene.Net.Documents.NumberTools.StringToLong ( System.String  str)
static

Converts a String that was returned by LongToString back to a long.

<throws> IllegalArgumentException </throws>

if the input is null

<throws> NumberFormatException </throws>

if the input does not parse (it was not a String returned by longToString()).

Definition at line 125 of file NumberTools.cs.

static long Lucene.Net.Documents.NumberTools.ToLong ( System.String  t)
static

Definition at line 208 of file NumberTools.cs.

static System.String Lucene.Net.Documents.NumberTools.ToString ( long  lval)
static

Definition at line 184 of file NumberTools.cs.

Member Data Documentation

readonly System.String Lucene.Net.Documents.NumberTools.MAX_STRING_VALUE = POSITIVE_PREFIX + "1y2p0ij32e8e7"
static

Equivalent to longToString(Long.MAX_VALUE)

Definition at line 69 of file NumberTools.cs.

readonly System.String Lucene.Net.Documents.NumberTools.MIN_STRING_VALUE = NEGATIVE_PREFIX + "0000000000000"
static

Equivalent to longToString(Long.MIN_VALUE)

Definition at line 62 of file NumberTools.cs.

readonly int Lucene.Net.Documents.NumberTools.STR_SIZE = MIN_STRING_VALUE.Length
static

The length of (all) strings returned by LongToString

Definition at line 75 of file NumberTools.cs.


The documentation for this class was generated from the following file: