gov.nist.nlpir.irf.document
Class ProxyDocument

java.lang.Object
  |
  +--gov.nist.nlpir.irf.proxy.VirtualProxy
        |
        +--gov.nist.nlpir.irf.document.ProxyDocument
Direct Known Subclasses:
ProxyHciDoc, ProxyTrecDocument

public abstract class ProxyDocument
extends VirtualProxy
implements DocumentIntrf

Parent class of all IR document proxies.

Version:
$Revision: 1.5 $
Author:
This software was produced by NIST, an agency of the U.S. government, and by statute is not subject to copyright in the United States. Recipients of this software assume all responsibilities associated with its operation, modification and maintenance.
See Also:
Serialized Form

Inner classes inherited from class gov.nist.nlpir.irf.proxy.VirtualProxy
VirtualProxy.IMP_Entry
 
Fields inherited from class gov.nist.nlpir.irf.proxy.VirtualProxy
broker, handles, inMemoryProxiesByOid, iS, objectIdentifier, realObject, serialVersionUID
 
Constructor Summary
ProxyDocument()
           
 
Method Summary
 void addHTML(java.lang.StringBuffer baseString, int unused, boolean form)
          Adds HTML to the given string buffer.
 boolean equals(java.lang.Object o)
          Tests whether two Documents have the same content
 java.util.Vector getFeatureNames()
          Gets feature names of document.
 java.util.Vector getFeatureTypes()
          Gets feature types of document.
 java.util.Vector getFeatureValues()
          Gets the values of the indexable features.
 VirtualProxy getFirstInstance()
          Enforce uniqueness of proxies by checking to see if a proxy for this IR document already exists and returning that reference if it exists; and see that analogous processing is carried out for the contained proxy data elements.
 java.util.Vector getIndexingFeatures(IndexingModalities im, ProxyDocument proxyDoc)
          Returns indexing features as a Vector of Vectors: one inner Vector for each modality unit.
 IndexingModalities getIndexingModalities()
          Gets indexing modalities for this document.
abstract  ProxyDocument getQueryDocument()
          Creates an IR document that can be used as a query.
 int hashCode()
          Returns a hashcode for an Document
 void index(IndexingModalities im, ProxyDocument proxyDoc)
          Indexes this document.
 void makeLightweight()
          Makes this proxy lightweight (cut the link to its real object) and sees that the same is done for the contained proxy data elements.
 void makePersistent()
          Passes the message on to each component object which is a proxy - telling it to make itself persistent.
 java.util.Vector makeResultsForDocMatchingQuery(QueryRep query, java.util.Vector collPartialResults)
          Makes a complete result for documents matching the supplied query from the partial results supplied.
 void present()
          Displays document in ascii form to screen
 void presentBrief()
          Displays document on one line to screen
 RetrievalResult retrieve(RetrievalModalities rm, ProxyDocument proxyDoc)
          Returns this document as a query.
 
Methods inherited from class gov.nist.nlpir.irf.proxy.VirtualProxy
addRefToInMemoryProxiesByOid, createBroker, deleteRefFromInMemoryProxiesByOid, dematerializeRealObject, dematerializeRealObject, getBroker, getInMemoryProxiesByOidBinCount, getInMemoryProxiesByOidSize, getInMemoryProxyCounts, getObjectIdentifier, getPersistenceBroker, getProxyFor, getRealObject, isLightweight, materializeRealObject, presentInMemoryProxies, readExternal, replaceRealObject, setBroker, setIS, setObjectIdentifier, setRealObject, testInMemoryProxiesByOidTable, toString, writeExternal
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

ProxyDocument

public ProxyDocument()
Method Detail

getFeatureNames

public java.util.Vector getFeatureNames()
Gets feature names of document.
Specified by:
getFeatureNames in interface DocumentIntrf
Returns:
The collection of feature names

getFeatureTypes

public java.util.Vector getFeatureTypes()
Gets feature types of document.
Specified by:
getFeatureTypes in interface DocumentIntrf
Returns:
A collection of feature types as Strings.

getFeatureValues

public java.util.Vector getFeatureValues()
Gets the values of the indexable features. Features can be indexed if they are declared public.
Specified by:
getFeatureValues in interface DocumentIntrf
Returns:
a collection of Data Elements (DataElem)

present

public void present()
Displays document in ascii form to screen
Specified by:
present in interface DocumentIntrf

presentBrief

public void presentBrief()
Displays document on one line to screen
Specified by:
presentBrief in interface DocumentIntrf

index

public void index(IndexingModalities im,
                  ProxyDocument proxyDoc)
Indexes this document.
Specified by:
index in interface DocumentIntrf
Parameters:
im - Indexing Modality list .

retrieve

public RetrievalResult retrieve(RetrievalModalities rm,
                                ProxyDocument proxyDoc)
Returns this document as a query.
Specified by:
retrieve in interface DocumentIntrf
Parameters:
rm - Retrieval Modalities
Returns:
The retrieval result for the given modalities.

getIndexingFeatures

public java.util.Vector getIndexingFeatures(IndexingModalities im,
                                            ProxyDocument proxyDoc)
Returns indexing features as a Vector of Vectors: one inner Vector for each modality unit.
Specified by:
getIndexingFeatures in interface DocumentIntrf
Parameters:
im - Indexing Modalities
Returns:
Vector containing vectors of indexing features

getIndexingModalities

public IndexingModalities getIndexingModalities()
Gets indexing modalities for this document. should be overriden by subclass.
Specified by:
getIndexingModalities in interface DocumentIntrf
Returns:
null always.

addHTML

public void addHTML(java.lang.StringBuffer baseString,
                    int unused,
                    boolean form)
Adds HTML to the given string buffer.
Specified by:
addHTML in interface DocumentIntrf
Parameters:
baseString - The StringBuffer the HTML text will be appended to.
unused - Unused.
form - Boolean set to true if you wish HTML document to be a form document.

makeResultsForDocMatchingQuery

public java.util.Vector makeResultsForDocMatchingQuery(QueryRep query,
                                                       java.util.Vector collPartialResults)
Makes a complete result for documents matching the supplied query from the partial results supplied.
Specified by:
makeResultsForDocMatchingQuery in interface DocumentIntrf
Parameters:
query - The query to match.
collPR - A collection of partial Results.
Returns:
A Vector of ResultForDocMatchingQuery. There is one of them by Document in the results, containing every Result..ModalityUnit linked to this document.

makePersistent

public void makePersistent()
Passes the message on to each component object which is a proxy - telling it to make itself persistent. Then make this object persistent and return its handle.
Overrides:
makePersistent in class VirtualProxy

hashCode

public int hashCode()
Returns a hashcode for an Document
Returns:
the hashcode for the Document
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Tests whether two Documents have the same content
Returns:
the hashcode for the Document
Overrides:
equals in class java.lang.Object

getFirstInstance

public VirtualProxy getFirstInstance()
Enforce uniqueness of proxies by checking to see if a proxy for this IR document already exists and returning that reference if it exists; and see that analogous processing is carried out for the contained proxy data elements.

Document potentially contains Proxies, so that its proxy if forced to override the default method in VirtualProxy to call getFirstInstance on all its members. This proxy must thus override the default method to call this cleaning function in Document.
Returns:
the reference to any pre-existing proxy for this one's real object; if none pre-exists, return a reference to self.
Overrides:
getFirstInstance in class VirtualProxy

getQueryDocument

public abstract ProxyDocument getQueryDocument()
Creates an IR document that can be used as a query.
Returns:
a proxy Document suitable for use as a query

makeLightweight

public void makeLightweight()
Makes this proxy lightweight (cut the link to its real object) and sees that the same is done for the contained proxy data elements.
Overrides:
makeLightweight in class VirtualProxy