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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
NumericTokenStream.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef NUMERICTOKENSTREAM_H
8 #define NUMERICTOKENSTREAM_H
9 
10 #include "TokenStream.h"
11 
12 namespace Lucene
13 {
52  class LPPAPI NumericTokenStream : public TokenStream
53  {
54  public:
59 
62  NumericTokenStream(int32_t precisionStep);
63 
67  NumericTokenStream(AttributeSourcePtr source, int32_t precisionStep);
68 
72  NumericTokenStream(AttributeFactoryPtr factory, int32_t precisionStep);
73 
74  virtual ~NumericTokenStream();
75 
77 
78  protected:
82 
83  int32_t shift;
84  int32_t valSize; // valSize == 0 means not initialized
85  int32_t precisionStep;
86 
87  int64_t value;
88 
89  public:
91  static const String& TOKEN_TYPE_FULL_PREC();
92 
94  static const String& TOKEN_TYPE_LOWER_PREC();
95 
100  NumericTokenStreamPtr setLongValue(int64_t value);
101 
106  NumericTokenStreamPtr setIntValue(int32_t value);
107 
112  NumericTokenStreamPtr setDoubleValue(double value);
113 
114  virtual void reset();
115  virtual bool incrementToken();
116  virtual String toString();
117  };
118 }
119 
120 #endif

clucene.sourceforge.net