|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lempinen.neatseeker.core.Bucket
Class that represents a single Bucket (a TreeMap). The TreeMaps contained within the Buckets are the heart and soul of NeatSeeker. They contain a set of Pointer objects indexed according to the individual keywords.
An example: suppose that the file /etc/killfile
contains
the string Microsoft. During indexing, the Repository is asked
to add this keyword to the index. The Repository determines that
Microsoft belongs to the Bucket stored in the file
mic.map
in the repository root directory. The Repository
loads this Bucket from disk (or creates a new one), and asks the Bucket
to add a Pointer object for /etc/killfile
into the index
with the keyword Microsoft. Simple.
The requests for adding index entries are encapsulated in Entry objects. These objects are not stored in the index -- they are merely used for passing messages.
Repository
,
Pointer
Field Summary | |
private java.util.TreeMap |
map
The TreeMap to hold the keyword index. |
private java.lang.String |
mapfile
The path where to store the serialized TreeMap object. |
Constructor Summary | |
Bucket(java.lang.String file)
Constructs a new Bucket, with the map file in file . |
Method Summary | |
void |
add(Entry entry)
Adds a specific key-value pair into the map. |
void |
load()
Reads the TreeMap object from a serialized file. |
void |
save()
Writes the TreeMap object in a file |
PointerList |
search(java.lang.String key)
Searches for a specific key in the index. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.util.TreeMap map
private java.lang.String mapfile
Constructor Detail |
public Bucket(java.lang.String file)
file
.Method Detail |
public void load() throws java.io.FileNotFoundException, java.io.StreamCorruptedException, java.io.IOException, java.lang.ClassNotFoundException
public void save() throws java.io.FileNotFoundException, java.io.IOException
public PointerList search(java.lang.String key)
public void add(Entry entry)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |