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

Loading...
Searching...
No Matches
DoubleFieldSource.h
Go to the documentation of this file.
1
2// 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 DOUBLEFIELDSOURCE_H
8#define DOUBLEFIELDSOURCE_H
9
10#include "FieldCacheSource.h"
11#include "DocValues.h"
12
13 namespace Lucene {
14
25 class DoubleFieldSource : public FieldCacheSource {
26 public:
28 DoubleFieldSource(const String& field, const DoubleParserPtr& parser = DoubleParserPtr());
29 virtual ~DoubleFieldSource();
30
31 LUCENE_CLASS(DoubleFieldSource);
32
33 protected:
34 DoubleParserPtr parser;
35
36 public:
37 virtual String description();
38 virtual DocValuesPtr getCachedFieldValues(const FieldCachePtr& cache, const String& field, const IndexReaderPtr& reader);
39 virtual bool cachedFieldSourceEquals(const FieldCacheSourcePtr& other);
40 virtual int32_t cachedFieldSourceHashCode();
41};
42
43 class DoubleDocValues : public DocValues {
44 public:
45 DoubleDocValues(const DoubleFieldSourcePtr& source, Collection<double> arr);
46 virtual ~DoubleDocValues();
47
48 LUCENE_CLASS(DoubleDocValues);
49
50 protected:
51 DoubleFieldSourceWeakPtr _source;
52 Collection<double> arr;
53
54 public:
55 virtual double doubleVal(int32_t doc);
56 virtual String toString(int32_t doc);
57 virtual CollectionValue getInnerArray();
58};
59
60}
61
62#endif
DocValues.h
FieldCacheSource.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::DocValues::DocValues
DocValues()
Lucene::DoubleDocValues::_source
DoubleFieldSourceWeakPtr _source
Definition DoubleFieldSource.h:51
Lucene::DoubleDocValues::arr
Collection< double > arr
Definition DoubleFieldSource.h:52
Lucene::DoubleDocValues::~DoubleDocValues
virtual ~DoubleDocValues()
Lucene::DoubleDocValues::DoubleDocValues
DoubleDocValues(const DoubleFieldSourcePtr &source, Collection< double > arr)
Lucene::DoubleDocValues::doubleVal
virtual double doubleVal(int32_t doc)
Return doc value as a double. Mandatory: every DocValues implementation must implement at least this ...
Lucene::DoubleDocValues::toString
virtual String toString(int32_t doc)
Return a string representation of a doc value, as required for Explanations.
Lucene::DoubleDocValues::getInnerArray
virtual CollectionValue getInnerArray()
For test purposes only, return the inner array of values, or null if not applicable.
Lucene::DoubleFieldSource::description
virtual String description()
Description of field, used in explain().
Lucene::DoubleFieldSource::parser
DoubleParserPtr parser
Definition DoubleFieldSource.h:34
Lucene::DoubleFieldSource::getCachedFieldValues
virtual DocValuesPtr getCachedFieldValues(const FieldCachePtr &cache, const String &field, const IndexReaderPtr &reader)
Return cached DocValues for input field and reader.
Lucene::DoubleFieldSource::DoubleFieldSource
DoubleFieldSource(const String &field, const DoubleParserPtr &parser=DoubleParserPtr())
Create a cached double field source with a specific string-to-double parser.
Lucene::DoubleFieldSource::cachedFieldSourceHashCode
virtual int32_t cachedFieldSourceHashCode()
Return a hash code of a FieldCacheSource, without the hash-codes of the field and the cache (those ar...
Lucene::DoubleFieldSource::~DoubleFieldSource
virtual ~DoubleFieldSource()
Lucene::DoubleFieldSource::cachedFieldSourceEquals
virtual bool cachedFieldSourceEquals(const FieldCacheSourcePtr &other)
Check if equals to another FieldCacheSource, already knowing that cache and field are equal.
Lucene::FieldCacheSource::FieldCacheSource
FieldCacheSource(const String &field)
Create a cached field source for the input field.
Lucene::FieldCacheSource::field
String field
Definition FieldCacheSource.h:37
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::DoubleParserPtr
boost::shared_ptr< DoubleParser > DoubleParserPtr
Definition LuceneTypes.h:328
Lucene::DoubleFieldSourceWeakPtr
boost::weak_ptr< DoubleFieldSource > DoubleFieldSourceWeakPtr
Definition LuceneTypes.h:327
Lucene::DoubleFieldSourcePtr
boost::shared_ptr< DoubleFieldSource > DoubleFieldSourcePtr
Definition LuceneTypes.h:327
Lucene::FieldCacheSourcePtr
boost::shared_ptr< FieldCacheSource > FieldCacheSourcePtr
Definition LuceneTypes.h:345
Lucene::DocValuesPtr
boost::shared_ptr< DocValues > DocValuesPtr
Definition LuceneTypes.h:325
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157
Lucene::FieldCachePtr
boost::shared_ptr< FieldCache > FieldCachePtr
Definition LuceneTypes.h:334

clucene.sourceforge.net