public class MemoryBarrel extends Object implements Barrel, BarrelReader, BarrelWriter
Document's metadata are stored in a Vector. Inverted list's metadata are stored in a TreeMap.
Constructor and Description |
---|
MemoryBarrel()
Constructor for the MemBarrel object.
|
MemoryBarrel(BarrelReader old)
Use the given Barrel to construct a new one.
|
Modifier and Type | Method and Description |
---|---|
void |
append(BarrelReader old)
Append the given Barrel to this one.
|
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(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(String label)
Return the Bitmap of a given label.
|
SequenceWithClose<DocumentData> |
getDocuments()
Return the documents making up this Barrel.
|
IListMetadata |
getIListMeta(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(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(String label,
Bitmap bitmap)
Try to set the Bitmap of a given label.
|
long |
size()
Return the size of this Barrel.
|
public MemoryBarrel()
public MemoryBarrel(BarrelReader old)
old
- the Barrel to copypublic Bitmap getBitmap(String label)
Barrel
public SequenceWithClose<DocumentData> getDocuments()
getDocuments
in interface BarrelReader
public IListMetadata getIListMeta(String term)
getIListMeta
in interface Barrel
term
- the term for which the desired inverted list was constructedpublic SequenceWithClose<IListReader> getILists()
getILists
in interface BarrelReader
public DocumentData getMeta(long uid)
public Sequence<? extends IListMetadata> expand(String expr)
public BarrelReader open()
public void clear()
public boolean removeDoc(long id)
public long length()
length
in interface BarrelReader
public long size()
public long deleted()
public void close()
close
in interface AutoCloseable
close
in interface Barrel
close
in interface BarrelReader
close
in interface BarrelWriter
public void rewind()
rewind
in interface BarrelReader
public void commit()
public IListReader openIList(String term, boolean clean)
public void append(BarrelReader old)
Note: Calls to this method must be synchronized.
append
in interface BarrelWriter
old
- the Barrel to appendpublic void query(Query q, ResultList result)
Copyright © 2016 Egothor. All Rights Reserved.