|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.egothor.core.memory.Document
public class Document
The Document object represents a real document. A Document is characterized by its metadata and a tree structure of fields. A Document is a special kind of a Barrel.
Case 1: The Document contains just one field (our implementation).
That object represents a Barrel that has just one active document (until it
is removed): the document itself; and it has a set of inverted lists. The
length of each list is one item.
Case 2: The Document contains more fields.
Not supported in this release. Currently, our implementation adds a prefix to
each term. That prefix is computed from the field name and its position in
the tree of fields. For example:
Given the tree structure: [root_field, term1 term2 [child1, term11 term12]
term1 [child2, term1 term2],
Egothor produces these inverted lists:
Users are welcome to implement another format of storing data. Document
implements two basic interfaces: BarrelReader and Barrel. The first one
allows the passing of a Document to a real Barrel (or rather, BarrelWriter)
via BarrelWriter.append(org.egothor.core.BarrelReader).
| Field Summary | |
|---|---|
protected java.util.TreeMap<java.lang.String,org.egothor.core.memory.MemoryProximities> |
ilists
The inverted lists constructed from terms in this document. |
| Constructor Summary | |
|---|---|
Document()
Constructor for the Document object |
|
| Method Summary | |
|---|---|
void |
close()
Not implemented but required by Barrel. |
void |
commit()
Not implemented but required by Barrel. |
long |
deleted()
Return the number of removed documents. |
void |
destroy()
Not implemented. |
Sequence<IListMetadata> |
expand(java.lang.String expr)
Not implemented. |
Bitmap |
getBitmap(java.lang.String label)
Return the Bitmap of a given label. |
SequenceWithClose<DocumentData> |
getDocuments()
Return an Enumeration of the documents. |
IListMetadata |
getIListMeta(java.lang.String term)
Return a simple IListMetadata structure that computes its getLength() as size()-deleted(). |
SequenceWithClose<IListReader> |
getILists()
Return all inverted lists in A-Z order of terms. |
DocumentData |
getMeta(long id)
Return the metadata of this document. |
void |
initialize(DocumentData meta,
FTField root)
Initializator for the Document object. |
boolean |
isWithoutTerms()
Test whether this document contains at least one term. |
long |
length()
Return the length of this data structure. |
BarrelReader |
open()
Return this object. |
IListReader |
openIList(java.lang.String term,
boolean clean)
Opens the IListReader of the given term. |
void |
query(Query q,
ResultList result)
Not implemented.. |
boolean |
removeDoc(long id)
Remove this document if and only if id is equal to root's
field element UID. |
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 data structure. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.TreeMap<java.lang.String,org.egothor.core.memory.MemoryProximities> ilists
| Constructor Detail |
|---|
public Document()
| 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 to search this Document's Hashtable
public SequenceWithClose<IListReader> getILists()
getILists in interface BarrelReaderpublic DocumentData getMeta(long id)
getMeta in interface Barrelid - the ID of the desired document
id is not equal to
org.egothor.Constants.FIRSTUIDConstants.FIRSTUIDpublic boolean isWithoutTerms()
public void initialize(DocumentData meta,
FTField root)
meta and
root to local variables and calls FTField.invertize(). It prepares the inverted lists structure.
meta - contains the metadata of the Documentroot - this Document's place in the tree (in this implementation the
tree has one element making this Document the root)public Sequence<IListMetadata> expand(java.lang.String expr)
expand in interface Barrelexpr - the expression
public void query(Query q,
ResultList result)
query in interface Barrelq - the queryresult - will calculate similarity to the querypublic BarrelReader open()
open in interface Barrelpublic void destroy()
destroy in interface Barrelpublic long size()
size in interface Barrelpublic long length()
length in interface BarrelReaderpublic long deleted()
deleted in interface BarrelremoveDoc(long)public boolean removeDoc(long id)
id is equal to root's
field element UID.
removeDoc in interface Barrelid - the ID of the document to remove
public void close()
close in interface Barrelclose in interface BarrelReaderpublic void rewind()
rewind in interface BarrelReaderpublic void commit()
commit in interface Barrel
public IListReader openIList(java.lang.String term,
boolean clean)
term.
openIList in interface Barrelterm - the term to open an IListReader forclean - whether to remove all the items denoted as deleted
term is a
term that does not occur in the document
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 | |||||||||