gov.nist.nlpir.irf.document
Class Document

java.lang.Object
  |
  +--gov.nist.nlpir.irf.document.Document
Direct Known Subclasses:
HciDoc, TrecDocument

public abstract class Document
extends java.lang.Object
implements DocumentIntrf

Parent class of all document classes. To create a new type of document, subclass this and create instance variables for the fields you want to support in the document. There is an example of this in gov.nist.nlpir.irfapps.hci.HciDoc. (gov.nist.nlpir.irfapps.hci.HciDoc.java)

Version:
$Revision: 1.6 $
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:
Index, IdxIntern, HciDoc

Field Summary
private  boolean proxyRefsCountedTrue
          Flag indicating if references to contained proxies can be counted
private static java.lang.String UID_String
          Name of a system-supplied field
 
Constructor Summary
Document()
           
 
Method Summary
 void addHTML(java.lang.StringBuffer baseString, int unused, boolean form)
          Adds HTML to the given string buffer.
 void finalize()
          Updates the counts of references to proxies for the contained proxy data elements before this document is garbage collected
 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.
 void getFirstInstances()
          Completes the recursion of getFirstInstance() calls
 java.util.Vector getIndexingFeatures(IndexingModalities im, ProxyDocument proxyDoc)
          Returns indexing features as a Vector of Vectors: one inner Vector for each modality unit (i.e., document field, index).
 IndexingModalities getIndexingModalities()
          Gets indexing modalities for this document.
abstract  Document getQueryDocument()
          Build an IR document suitable for use as a query
 void index(IndexingModalities im, ProxyDocument proxyDoc)
          Indexes this document.
 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 standard out
 RetrievalResult retrieve(RetrievalModalities rm, ProxyDocument proxyDoc)
          Retrieves relevant documents to this one, as defined by the passed retreival modalities
 void setProxyRefsCountedTrue()
           
private static java.lang.String typeName(java.lang.Class t)
          Returns the name of an interface or primitive type
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

UID_String

private static final java.lang.String UID_String
Name of a system-supplied field

proxyRefsCountedTrue

private boolean proxyRefsCountedTrue
Flag indicating if references to contained proxies can be counted
Constructor Detail

Document

public Document()
Method Detail

setProxyRefsCountedTrue

public void setProxyRefsCountedTrue()

getFeatureNames

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

typeName

private static final java.lang.String typeName(java.lang.Class t)
Returns the name of an interface or primitive type
Returns:
the name of an interface or primitive type, handling arrays.

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 standard out
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 - information to control indexing
proxyDoc - proxy IR document needed for the indexing features

retrieve

public RetrievalResult retrieve(RetrievalModalities rm,
                                ProxyDocument proxyDoc)
Retrieves relevant documents to this one, as defined by the passed retreival modalities
Specified by:
retrieve in interface DocumentIntrf
Parameters:
rm - Information controling retrieval
proxyDoc - A proxy IR document needed for the results built
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 (i.e., document field, index).
Specified by:
getIndexingFeatures in interface DocumentIntrf
Parameters:
im - Information controling indexing
proxyDoc - A proxy IR document need to build indexing features
Returns:
Vector of vectors of indexing features from this document

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.

getFirstInstances

public void getFirstInstances()
Completes the recursion of getFirstInstance() calls
See Also:
VirtualProxy.getFirstInstance()

getQueryDocument

public abstract Document getQueryDocument()
Build an IR document suitable for use as a query

finalize

public void finalize()
Updates the counts of references to proxies for the contained proxy data elements before this document is garbage collected
Overrides:
finalize in class java.lang.Object