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


SortedVIntList.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 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 SORTEDVINTLIST_H
8 #define SORTEDVINTLIST_H
9 
10 #include "DocIdSet.h"
11 
12 namespace Lucene {
13 
22 class LPPAPI SortedVIntList : public DocIdSet {
23 public:
27 
31  SortedVIntList(Collection<int32_t> sortedInts, int32_t inputSize);
32 
35  SortedVIntList(const BitSetPtr& bits);
36 
40 
45  SortedVIntList(const DocIdSetIteratorPtr& docIdSetIterator);
46 
47  virtual ~SortedVIntList();
48 
50 
51 public:
54  static const int32_t BITS2VINTLIST_SIZE;
55 
56 protected:
57  static const int32_t VB1;
58  static const int32_t BIT_SHIFT;
59  static const int32_t MAX_BYTES_PER_INT;
60 
61  int32_t _size;
62  ByteArray bytes;
63  int32_t lastBytePos;
64  int32_t lastInt;
65 
66 public:
68  int32_t size();
69 
71  int32_t getByteSize();
72 
74  virtual bool isCacheable();
75 
78 
79 protected:
80  void initBytes();
81  void addInt(int32_t nextInt);
82 
83  friend class SortedDocIdSetIterator;
84 };
85 
86 }
87 
88 #endif
Lucene::SortedVIntList::SortedVIntList
SortedVIntList(const OpenBitSetPtr &bits)
Create a SortedVIntList from an OpenBitSet.
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::BitSetPtr
boost::shared_ptr< BitSet > BitSetPtr
Definition: LuceneTypes.h:522
Lucene::SortedVIntList::SortedVIntList
SortedVIntList(const BitSetPtr &bits)
Create a SortedVIntList from a BitSet.
Lucene::Collection< int32_t >
Lucene::SortedVIntList::lastBytePos
int32_t lastBytePos
Definition: SortedVIntList.h:63
Lucene::SortedVIntList::SortedVIntList
SortedVIntList(const DocIdSetIteratorPtr &docIdSetIterator)
Create a SortedVIntList.
Lucene::SortedVIntList::iterator
virtual DocIdSetIteratorPtr iterator()
Lucene::SortedVIntList::addInt
void addInt(int32_t nextInt)
Lucene::SortedVIntList::SortedVIntList
SortedVIntList(Collection< int32_t > sortedInts)
Create a SortedVIntList from all elements of an array of integers.
Lucene::SortedVIntList::lastInt
int32_t lastInt
Definition: SortedVIntList.h:64
DocIdSet.h
Lucene::SortedVIntList::BIT_SHIFT
static const int32_t BIT_SHIFT
Definition: SortedVIntList.h:58
Lucene::SortedVIntList::MAX_BYTES_PER_INT
static const int32_t MAX_BYTES_PER_INT
Definition: SortedVIntList.h:59
Lucene::SortedVIntList::initBytes
void initBytes()
Lucene::DocIdSet
A DocIdSet contains a set of doc ids. Implementing classes must only implement iterator to provide ac...
Definition: DocIdSet.h:16
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::DocIdSetIteratorPtr
boost::shared_ptr< DocIdSetIterator > DocIdSetIteratorPtr
Definition: LuceneTypes.h:324
Lucene::OpenBitSetPtr
boost::shared_ptr< OpenBitSet > OpenBitSetPtr
Definition: LuceneTypes.h:543
Lucene::SortedVIntList::SortedVIntList
SortedVIntList(Collection< int32_t > sortedInts, int32_t inputSize)
Create a SortedVIntList from an array of integers.
Lucene::SortedVIntList::VB1
static const int32_t VB1
Definition: SortedVIntList.h:57
Lucene::SortedVIntList
Stores and iterate on sorted integers in compressed form in RAM.
Definition: SortedVIntList.h:22
Lucene::SortedVIntList::BITS2VINTLIST_SIZE
static const int32_t BITS2VINTLIST_SIZE
When a BitSet has fewer than 1 in BITS2VINTLIST_SIZE bits set, a SortedVIntList representing the inde...
Definition: SortedVIntList.h:49
Lucene::SortedVIntList::getByteSize
int32_t getByteSize()
Lucene::SortedVIntList::~SortedVIntList
virtual ~SortedVIntList()
Lucene::SortedVIntList::size
int32_t size()
Lucene::SortedVIntList::isCacheable
virtual bool isCacheable()
This DocIdSet implementation is cacheable.
Lucene::SortedVIntList::bytes
ByteArray bytes
Definition: SortedVIntList.h:62
Lucene::SortedVIntList::_size
int32_t _size
Definition: SortedVIntList.h:61

clucene.sourceforge.net