1
/*------------------------------------------------------------------------------
2
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
4
* Distributable under the terms of either the Apache License (Version 2.0) or
5
* the GNU Lesser General Public License, as specified in the COPYING file.
6
------------------------------------------------------------------------------*/
7
#ifndef _lucene_search_CachingSpanFilter_
8
#define _lucene_search_CachingSpanFilter_
10
#include "SpanFilter.h"
15
* Wraps another SpanFilter's result and caches it. The purpose is to allow
16
* filters to simply filter, and then wrap with this class to add caching.
18
class CachingSpanFilter : public SpanFilter
28
CachingSpanFilter( const CachingSpanFilter& copy );
32
* @param filter Filter to cache results of
34
CachingSpanFilter( SpanFilter * filter, bool deleteFilter=true );
36
virtual ~CachingSpanFilter();
38
virtual Filter* clone() const;
40
virtual CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader * reader );
42
virtual SpanFilterResult * bitSpans( CL_NS(index)::IndexReader * reader );
44
virtual TCHAR* toString();
47
SpanFilterResult * getCachedResult( CL_NS(index)::IndexReader * reader );
49
// public boolean equals(Object o) {
50
// if (!(o instanceof CachingSpanFilter)) return false;
51
// return this.filter.equals(((CachingSpanFilter)o).filter);
54
// public int hashCode() {
55
// return filter.hashCode() ^ 0x1117BF25;
60
#endif // _lucene_search_CachingSpanFilter_