|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.egothor.core.memory.MemoryBarrel
public class MemoryBarrel
This is a basic implementation of all three types of Barrels in memory. DO NOT USE this implementation for more than few dozens of documents; it is quite memory intensive. This class is not synchronized.
Document's metadata are stored in a Vector. Inverted list's metadata are stored in a TreeMap.
Constructor Summary | |
---|---|
MemoryBarrel()
Constructor for the MemBarrel object. |
|
MemoryBarrel(BarrelReader old)
Use the given Barrel to construct a new one. |
Method Summary | |
---|---|
void |
append(BarrelReader old)
Append the given Barrel to this one. |
protected void |
appendIList(IListReader il,
long remap)
Append a new inverted list. |
void |
clear()
Description of the Method |
void |
close()
Not implemented but required by Barrel. |
void |
commit()
Not implemented but required by Barrel. |
long |
deleted()
Return the number of deleted documents. |
void |
destroy()
Destroy this Barrel. |
Sequence<? extends IListMetadata> |
expand(java.lang.String expr)
Return an Enumeration which will contain inverted list metadata for any inverted list constructed for a term containing the given regular expression. |
Bitmap |
getBitmap(java.lang.String label)
Return the Bitmap of a given label. |
SequenceWithClose<DocumentData> |
getDocuments()
Return the documents making up this Barrel. |
IListMetadata |
getIListMeta(java.lang.String term)
Return the metadata of the inverted list constructed for the given term. |
SequenceWithClose<IListReader> |
getILists()
Return the inverted lists in this Barrel. |
DocumentData |
getMeta(long uid)
Return the metadata of the document with the given unique ID. |
long |
length()
Return the number of active (not deleted) documents. |
BarrelReader |
open()
Return this object. |
IListReader |
openIList(java.lang.String term,
boolean clean)
Return an IListReader that can read the inverted list constructed for the given term. |
void |
query(Query q,
ResultList result)
Not implemented. |
boolean |
removeDoc(long id)
Remove the document with the given unique ID. |
void |
rewind()
Restart this BarrelReader so that the documents can be read again. |
void |
setBitmap(java.lang.String label,
Bitmap bitmap)
Try to set the Bitmap of a given label. |
long |
size()
Return the size of this Barrel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemoryBarrel()
public MemoryBarrel(BarrelReader old)
old
- the Barrel to copyMethod Detail |
---|
public Bitmap getBitmap(java.lang.String label)
Barrel
getBitmap
in interface Barrel
label
- the label of the requested Bitmap
public SequenceWithClose<DocumentData> getDocuments()
getDocuments
in interface BarrelReader
public IListMetadata getIListMeta(java.lang.String term)
getIListMeta
in interface Barrel
term
- the term for which the desired inverted list was constructed
public SequenceWithClose<IListReader> getILists()
getILists
in interface BarrelReader
public DocumentData getMeta(long uid)
getMeta
in interface Barrel
uid
- the ID of the desired document
public Sequence<? extends IListMetadata> expand(java.lang.String expr)
expand
in interface Barrel
expr
- the regular expression to be contained in the term(s)
public BarrelReader open()
open
in interface Barrel
public void destroy()
destroy
in interface Barrel
public void clear()
public boolean removeDoc(long id)
removeDoc
in interface Barrel
id
- the document to remove
public long length()
length
in interface BarrelReader
public long size()
size
in interface Barrel
public long deleted()
deleted
in interface Barrel
public void close()
close
in interface Barrel
close
in interface BarrelReader
close
in interface BarrelWriter
public void rewind()
rewind
in interface BarrelReader
public void commit()
commit
in interface Barrel
public IListReader openIList(java.lang.String term, boolean clean)
openIList
in interface Barrel
term
- the term for which the desired inverted list was constructedclean
- whether to remove all the items denoted as deleted
public void append(BarrelReader old)
Note: Calls to this method must be synchronized.
append
in interface BarrelWriter
old
- the Barrel to appendprotected void appendIList(IListReader il, long remap) throws java.io.IOException
remap
value.
il
- the inverted list to appendremap
- the factor by which document IDs should be increased
java.io.IOException
public void query(Query q, ResultList result)
query
in interface Barrel
q
- the queryresult
- the list of resultspublic void setBitmap(java.lang.String label, Bitmap bitmap)
Barrel
setBitmap
in interface Barrel
label
- the label of the requested Bitmapbitmap
- Bitmap of removed documents when label is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |