|
||||||||||
| 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 copy| Method Detail |
|---|
public Bitmap getBitmap(java.lang.String label)
Barrel
getBitmap in interface Barrellabel - the label of the requested Bitmap
public SequenceWithClose<DocumentData> getDocuments()
getDocuments in interface BarrelReaderpublic IListMetadata getIListMeta(java.lang.String term)
getIListMeta in interface Barrelterm - the term for which the desired inverted list was constructed
public SequenceWithClose<IListReader> getILists()
getILists in interface BarrelReaderpublic DocumentData getMeta(long uid)
getMeta in interface Barreluid - the ID of the desired document
public Sequence<? extends IListMetadata> expand(java.lang.String expr)
expand in interface Barrelexpr - the regular expression to be contained in the term(s)
public BarrelReader open()
open in interface Barrelpublic void destroy()
destroy in interface Barrelpublic void clear()
public boolean removeDoc(long id)
removeDoc in interface Barrelid - the document to remove
public long length()
length in interface BarrelReaderpublic long size()
size in interface Barrelpublic long deleted()
deleted in interface Barrelpublic void close()
close in interface Barrelclose in interface BarrelReaderclose in interface BarrelWriterpublic void rewind()
rewind in interface BarrelReaderpublic void commit()
commit in interface Barrel
public IListReader openIList(java.lang.String term,
boolean clean)
openIList in interface Barrelterm - 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 BarrelWriterold - the Barrel to append
protected 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 Barrelq - the queryresult - the list of results
public void setBitmap(java.lang.String label,
Bitmap bitmap)
Barrel
setBitmap in interface Barrellabel - 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 | |||||||||