|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.annic.apache.lucene.search.FieldCacheImpl
class FieldCacheImpl
Expert: The default cache implementation, storing all values in memory. A WeakHashMap is used for storage.
Created: May 19, 2004 4:40:36 PM
| Nested Class Summary | |
|---|---|
(package private) static class |
FieldCacheImpl.Entry
Expert: Every key in the internal cache is of this type. |
| Nested classes/interfaces inherited from interface gate.creole.annic.apache.lucene.search.FieldCache |
|---|
FieldCache.StringIndex |
| Field Summary | |
|---|---|
(package private) Map |
cache
The internal cache. |
| Fields inherited from interface gate.creole.annic.apache.lucene.search.FieldCache |
|---|
DEFAULT, STRING_INDEX |
| Constructor Summary | |
|---|---|
FieldCacheImpl()
|
|
| Method Summary | |
|---|---|
Object |
getAuto(IndexReader reader,
String field)
removed for java 1.3 compatibility protected static final Object pFloats = Pattern.compile ("[0-9+\\-\\.eEfFdD]+"); |
Comparable[] |
getCustom(IndexReader reader,
String field,
SortComparator comparator)
Checks the internal cache for an appropriate entry, and if none is found reads the terms out of field and calls the given SortComparator
to get the sort values. |
float[] |
getFloats(IndexReader reader,
String field)
Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array
of size reader.maxDoc() of the value each document
has in the given field. |
int[] |
getInts(IndexReader reader,
String field)
Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array
of size reader.maxDoc() of the value each document
has in the given field. |
FieldCache.StringIndex |
getStringIndex(IndexReader reader,
String field)
Checks the internal cache for an appropriate entry, and if none is found reads the term values in field and returns
an array of them in natural order, along with an array telling
which element in the term array each document uses. |
String[] |
getStrings(IndexReader reader,
String field)
Checks the internal cache for an appropriate entry, and if none is found, reads the term values in field and returns an array
of size reader.maxDoc() containing the value each document
has in the given field. |
(package private) Object |
lookup(IndexReader reader,
String field,
int type)
See if an object is in the cache. |
(package private) Object |
lookup(IndexReader reader,
String field,
Object comparer)
See if a custom object is in the cache. |
(package private) Object |
store(IndexReader reader,
String field,
int type,
Object value)
Put an object into the cache. |
(package private) Object |
store(IndexReader reader,
String field,
Object comparer,
Object value)
Put a custom object into the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final Map cache
| Constructor Detail |
|---|
FieldCacheImpl()
| Method Detail |
|---|
Object lookup(IndexReader reader,
String field,
int type)
Object lookup(IndexReader reader,
String field,
Object comparer)
Object store(IndexReader reader,
String field,
int type,
Object value)
Object store(IndexReader reader,
String field,
Object comparer,
Object value)
public int[] getInts(IndexReader reader,
String field)
throws IOException
FieldCachefield as integers and returns an array
of size reader.maxDoc() of the value each document
has in the given field.
getInts in interface FieldCachereader - Used to get field values.field - Which field contains the integers.
IOException - If any error occurs.
public float[] getFloats(IndexReader reader,
String field)
throws IOException
FieldCachefield as floats and returns an array
of size reader.maxDoc() of the value each document
has in the given field.
getFloats in interface FieldCachereader - Used to get field values.field - Which field contains the floats.
IOException - If any error occurs.
public String[] getStrings(IndexReader reader,
String field)
throws IOException
FieldCachefield and returns an array
of size reader.maxDoc() containing the value each document
has in the given field.
getStrings in interface FieldCachereader - Used to get field values.field - Which field contains the strings.
IOException - If any error occurs.
public FieldCache.StringIndex getStringIndex(IndexReader reader,
String field)
throws IOException
FieldCachefield and returns
an array of them in natural order, along with an array telling
which element in the term array each document uses.
getStringIndex in interface FieldCachereader - Used to get field values.field - Which field contains the strings.
IOException - If any error occurs.
public Object getAuto(IndexReader reader,
String field)
throws IOException
getAuto in interface FieldCachereader - Used to get field values.field - Which field contains the values.
IOException - If any error occurs.
public Comparable[] getCustom(IndexReader reader,
String field,
SortComparator comparator)
throws IOException
FieldCachefield and calls the given SortComparator
to get the sort values. A hit in the cache will happen if reader,
field, and comparator are the same (using equals())
as a previous call to this method.
getCustom in interface FieldCachereader - Used to get field values.field - Which field contains the values.comparator - Used to convert terms into something to sort by.
IOException - If any error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||