Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Protected Attributes
Lucene::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...

`#include <NumberTools.h>`

Inheritance diagram for Lucene::NumberTools:

## Public Member Functions

virtual | ~NumberTools ()
virtual String | getClassName ()
boost::shared_ptr< NumberTools > | shared_from_this ()
Public Member Functions inherited from Lucene::LuceneObject
virtual | ~LuceneObject ()
virtual void | initialize ()
| Called directly after instantiation to create objects that depend on this object being fully constructed.
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object.
virtual int32_t | hashCode ()
| Return hash code for this object.
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal.
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects.
virtual String | toString ()
| Returns a string representation of the object.
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock.
virtual LuceneSignalPtr | getSignal ()
| Return this object signal.
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout.
virtual void | unlock ()
| Unlock this object.
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread.
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout.
virtual void | notifyAll ()
| Notify all threads waiting for signal.

## Static Public Member Functions

static String | _getClassName ()
static const String & | MIN_STRING_VALUE ()
| Equivalent to longToString(LLONG_MIN).
static const String & | MAX_STRING_VALUE ()
| Equivalent to longToString(LLONG_MAX).
static int32_t | STR_SIZE ()
| The length of (all) strings returned by `longToString`.
static String | longToString (int64_t l)
| Converts a long to a String suitable for indexing.
static int64_t | stringToLong (const String &str)
| Converts a String that was returned by `longToString` back to a long.

## Static Protected Attributes

static const int32_t | RADIX
static const wchar_t | NEGATIVE_PREFIX
static const wchar_t | POSITIVE_PREFIX

## Additional Inherited Members

Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## 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 `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`. This class is included for use with existing indices and will be removed in a future release (possibly Lucene 4.0).

## Constructor & Destructor Documentation

## ◆ ~NumberTools()

virtual Lucene::NumberTools::~NumberTools | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

String Lucene::NumberTools::_getClassName | ( |  | ) |

inline static

## ◆ getClassName()

virtual String Lucene::NumberTools::getClassName | ( |  | ) |

inline virtual

## ◆ longToString()

String Lucene::NumberTools::longToString | ( | int64_t | l | ) |

static

Converts a long to a String suitable for indexing.

## ◆ MAX_STRING_VALUE()

const String & Lucene::NumberTools::MAX_STRING_VALUE | ( |  | ) |

static

Equivalent to longToString(LLONG_MAX).

## ◆ MIN_STRING_VALUE()

const String & Lucene::NumberTools::MIN_STRING_VALUE | ( |  | ) |

static

Equivalent to longToString(LLONG_MIN).

## ◆ shared_from_this()

boost::shared_ptr< NumberTools > Lucene::NumberTools::shared_from_this | ( |  | ) |

inline

## ◆ STR_SIZE()

int32_t Lucene::NumberTools::STR_SIZE | ( |  | ) |

static

The length of (all) strings returned by `longToString`.

## ◆ stringToLong()

int64_t Lucene::NumberTools::stringToLong | ( | const String & | str | ) |

static

Converts a String that was returned by `longToString` back to a long.

## Field Documentation

## ◆ NEGATIVE_PREFIX

const wchar_t Lucene::NumberTools::NEGATIVE_PREFIX

static protected

## ◆ POSITIVE_PREFIX

const wchar_t Lucene::NumberTools::POSITIVE_PREFIX

static protected

## ◆ RADIX

const int32_t Lucene::NumberTools::RADIX

static protected

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

- NumberTools.h

clucene.sourceforge.net