gov.nist.nlpir.irf.de
Class ProxyDeString

java.lang.Object
  |
  +--gov.nist.nlpir.irf.proxy.VirtualProxy
        |
        +--gov.nist.nlpir.irf.de.ProxyDataElem
              |
              +--gov.nist.nlpir.irf.de.ProxyDeString
Direct Known Subclasses:
ProxyDeHtml

public class ProxyDeString
extends ProxyDataElem

An instance of this class is a proxy for a DeString object.

Version:
$Revision: 1.2 $
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
ProxyDeString()
          No-argument constructor
ProxyDeString(DeString s)
          Creates a proxy for the given DeString given a DeString
ProxyDeString(java.lang.String s)
          Creates a DeString with the given String and associates a new proxy to this DE.
 
Method Summary
 void addHTML(java.lang.StringBuffer baseString, int maxNumberOfChar, boolean form)
          Adds the string to the HTML text given.
 int compareTo(DataElem o)
          Scores the comparison between the real DeString and the given DeString
 PersistenceBroker createBroker()
          Creates a broker for this proxy object and remember it
 boolean exactMatch(DataElem de)
          Compares the associated DeString to another.
 java.util.Vector getIndexingFeatures(ProxyDocument source, IndexingModalities im, DataElem field)
          Extracts Indexing Features from the real DeString.
 java.lang.String getValue()
          Returns the String contained in the associated DeString.
 java.lang.String getValueAsString()
          Returns the associated DeString's value as a String
 int hashCode()
          Computes a hash code for the real DE_string based on the hashCode of the represented String.
 void HTML_ShowDoc(java.lang.StringBuffer baseString)
          Adds the value of the string between H1 tags to the given string.
 float match(DataElem de)
          Scores the match of the real DeString with another For the function to succeed, the object must be a DeString also.
 void present()
          Writes the associated DeString to standard out
 void presentBrief()
          Writes the associated DeString to standard out in a brief form
 void setValue(char[] v)
          Sets the String value of the associated DeString from this char array.
 void setValue(java.lang.String v)
          Sets the String value of the associated DeString.
 java.lang.String toString()
          Returns the associated DeString's value as a String
 
Methods inherited from class gov.nist.nlpir.irf.de.ProxyDataElem
equals
 
Methods inherited from class gov.nist.nlpir.irf.proxy.VirtualProxy
addRefToInMemoryProxiesByOid, deleteRefFromInMemoryProxiesByOid, dematerializeRealObject, dematerializeRealObject, getBroker, getFirstInstance, getInMemoryProxiesByOidBinCount, getInMemoryProxiesByOidSize, getInMemoryProxyCounts, getObjectIdentifier, getPersistenceBroker, getProxyFor, getRealObject, isLightweight, makeLightweight, makePersistent, materializeRealObject, presentInMemoryProxies, readExternal, replaceRealObject, setBroker, setIS, setObjectIdentifier, setRealObject, testInMemoryProxiesByOidTable, writeExternal
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

ProxyDeString

public ProxyDeString()
No-argument constructor

ProxyDeString

public ProxyDeString(DeString s)
Creates a proxy for the given DeString given a DeString

ProxyDeString

public ProxyDeString(java.lang.String s)
Creates a DeString with the given String and associates a new proxy to this DE.
Method Detail

getValue

public final java.lang.String getValue()
Returns the String contained in the associated DeString.

setValue

public final void setValue(java.lang.String v)
Sets the String value of the associated DeString.

setValue

public final void setValue(char[] v)
Sets the String value of the associated DeString from this char array.

getValueAsString

public final java.lang.String getValueAsString()
Returns the associated DeString's value as a String
Returns:
the associated DeString's value as a String

toString

public final java.lang.String toString()
Returns the associated DeString's value as a String
Returns:
the associated DeString's value as a String
Overrides:
toString in class VirtualProxy

present

public void present()
Writes the associated DeString to standard out

presentBrief

public void presentBrief()
Writes the associated DeString to standard out in a brief form

exactMatch

public boolean exactMatch(DataElem de)
Compares the associated DeString to another.
Parameters:
de - the DeString to compare to
Returns:
true if both represented Strings are the same,
false otherwise or if de is not a DeString.

match

public float match(DataElem de)
Scores the match of the real DeString with another For the function to succeed, the object must be a DeString also. Actually the result is 1 if the two objects exactly match, ie the Strings they represent are exactly the same, 0 otherwise.
Parameters:
de - the DeString to compared to
Returns:
the score of the matching process.

compareTo

public int compareTo(DataElem o)
Scores the comparison between the real DeString and the given DeString
Parameters:
o - the DeString to compare to
Returns:
the score as an int: the result is the comparison between the o2 String value and the value of this. Returns Integer.MAX_VALUE if o2 is not a DeString.
See Also:
String.compareTo(java.lang.Object)

hashCode

public int hashCode()
Computes a hash code for the real DE_string based on the hashCode of the represented String.
Returns:
hash code for use in java.util.Hashtable.
Overrides:
hashCode in class java.lang.Object

getIndexingFeatures

public java.util.Vector getIndexingFeatures(ProxyDocument source,
                                            IndexingModalities im,
                                            DataElem field)
Extracts Indexing Features from the real DeString.
Parameters:
source - object reference of source document.
im - indexing modalities to be used with this DeString.
field - the document field from which this DE came
Returns:
vector of IndexingFeatures.

addHTML

public void addHTML(java.lang.StringBuffer baseString,
                    int maxNumberOfChar,
                    boolean form)
Adds the string to the HTML text given. If it is to be read in a form, the HTML code will allow the entry of values.
Parameters:
baseString - the HTML text the value will be appended to.
maxNumberOfChar - maximum number of characters added, used only if form is false.
form - true if the HTML code must be used in a form, false otherwise.
Returns:
the new HTML string.

HTML_ShowDoc

public void HTML_ShowDoc(java.lang.StringBuffer baseString)
Adds the value of the string between H1 tags to the given string.

createBroker

public PersistenceBroker createBroker()
Creates a broker for this proxy object and remember it
Returns:
the broker for this object
Overrides:
createBroker in class VirtualProxy