|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.nlpir.irf.index.braf.IoAddrIntern
This class is the internal representation of a source, ie a document. It will be used as a key in the different indexes, but it also embeds information only used by indexes for retrieval: for instance, the score of the document, calculated by every index in a manner given by the index (IDF, keyword, ...), and the number of features this source refers to (in a text application, for example, the number of indexed terms found in this source for the considered fields -depending on the index). This class has been designed to be used in close conjunction with PersistentDualKeyContainer; it manages its own persistence mechanism, exactly like DeIntern. It may still be used in a different scheme in order to take advantage of the already implemented methods in IdxIntern and its subclasses without having to change them.
DeIntern
,
PersistentDualKeyContainer
Field Summary | |
private boolean |
dirty
Dirty bit. |
private ProxyDocument |
doc
The actual source this IoAddrIntern deals with. |
private int |
nrOfFeatures
Number of features found in the considered source. |
private double |
score
Score of this source, computed with an index-dependant heuristic. |
Constructor Summary | |
private |
IoAddrIntern(BufferedRandomAccessFile in)
This constructor is only called by readFrom() . |
|
IoAddrIntern(ProxyDocument doc)
Constructor which initializes the source to doc, nrOfFeatures to 0 and score to 0.0. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Completely overrides the equals in Object so that it is the one called by Hashtable for example. |
void |
finalize()
As this class contains a reference to a proxy, it needs a finalize method to complete housekeeping about references to proxies. |
ProxyDocument |
getDoc()
Returns the ProxyDocument of the IoAddrIntern. |
int |
getNrOfFeatures()
Returns the number of features of the IoAddrIntern. |
double |
getScore()
Returns the score of the IoAddrIntern. |
int |
hashCode()
Gives a hashcode based on the source document, otherwise indexing would encounter problems (features of the same source not indexed as being in the same source). Note: The default hashCode can only be accessed via super.hashCode(). |
boolean |
isDirty()
Returns the dirty bit status. |
static IoAddrIntern |
readFrom(BufferedRandomAccessFile in)
Tuned deserialization mechanism. |
void |
setDoc(ProxyDocument doc)
Sets the ProxyDocument of the IoAddrIntern. |
void |
setNrOfFeatures(int n)
Sets the number of features of the IoAddrIntern to the supplied value. |
void |
setScore(double s)
Sets the score of the IoAddrIntern to the supplied value. |
java.lang.String |
toString()
Generates the string representation of this IoAddrIntern. |
void |
writeTo(BufferedRandomAccessFile out)
Tuned serialization mechanism. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int nrOfFeatures
private double score
private ProxyDocument doc
private transient boolean dirty
Constructor Detail |
public IoAddrIntern(ProxyDocument doc)
anIO_Addr
- a ProxyDocument.private IoAddrIntern(BufferedRandomAccessFile in) throws java.io.IOException
readFrom()
.Method Detail |
public final double getScore()
public final int getNrOfFeatures()
public final void setNrOfFeatures(int n)
n
- number of features.public final void setScore(double s)
s
- the scorepublic final ProxyDocument getDoc()
public final void setDoc(ProxyDocument doc)
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object o)
public void writeTo(BufferedRandomAccessFile out) throws java.io.IOException
public static IoAddrIntern readFrom(BufferedRandomAccessFile in) throws java.io.IOException
public final boolean isDirty()
public void finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |