Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Classes | Public Member Functions | Protected Member Functions | Properties | List of all members
Lucene.Net.Util.Cache.SegmentCache< T > Class Template Referenceabstract

Custom cache with two levels of keys, outer key is the IndexReader with the inner key being a string, commonly a field name but can be anything. Refer to the unit tests for an example implementation.

Template Parameters
TThe type that is being cached.
More...

Inherits Lucene.Net.Util.Cache.AbstractSegmentCache.

Inherited by Lucene.Net.Util.Cache.SegmentCache< T >.WeakKey.

Classes

class  WeakKey
 A weak referene wrapper for the hashtable keys. Whenever a key pair is added to the hashtable, the key is wrapped using a WeakKey. WeakKey saves the value of the original object hashcode for fast comparison.
 

Public Member Functions

override void Warm (IndexReader reader, string key)
 Warm the cache - simply calls Get and ignores the return value.
 
virtual T Get (IndexReader reader, string key)
 Get the item from the cache.
 

Protected Member Functions

abstract T CreateValue (IndexReader reader, string key)
 Value creation.
 

Properties

int KeyCount [get]
 The number of outermost keys in the collection.
 

Detailed Description

Custom cache with two levels of keys, outer key is the IndexReader with the inner key being a string, commonly a field name but can be anything. Refer to the unit tests for an example implementation.

Template Parameters
TThe type that is being cached.

Definition at line 48 of file SegmentCache.cs.

Member Function Documentation

abstract T Lucene.Net.Util.Cache.SegmentCache< T >.CreateValue ( IndexReader  reader,
string  key 
)
protectedpure virtual

Value creation.

Parameters
readerThe reader.
keyThe key to the item under the reader.
Returns
The value.
virtual T Lucene.Net.Util.Cache.SegmentCache< T >.Get ( IndexReader  reader,
string  key 
)
virtual

Get the item from the cache.

Parameters
readerThe IndexReader the cache is from.
keyThe key of the item under the reader.
Returns
The item from cache.

Definition at line 92 of file SegmentCache.cs.

override void Lucene.Net.Util.Cache.SegmentCache< T >.Warm ( IndexReader  reader,
string  key 
)
virtual

Warm the cache - simply calls Get and ignores the return value.

Parameters
readerThe index reader to warm up.
keyThe key of the item under the reader.

Implements Lucene.Net.Util.Cache.AbstractSegmentCache.

Definition at line 81 of file SegmentCache.cs.

Property Documentation

int Lucene.Net.Util.Cache.SegmentCache< T >.KeyCount
get

The number of outermost keys in the collection.

Definition at line 72 of file SegmentCache.cs.


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