gov.nist.nlpir.irf.de
Class ProxyDeDouble

java.lang.Object
  |
  +--gov.nist.nlpir.irf.proxy.VirtualProxy
        |
        +--gov.nist.nlpir.irf.de.ProxyDataElem
              |
              +--gov.nist.nlpir.irf.de.ProxyDeDouble

public class ProxyDeDouble
extends ProxyDataElem

This class represents a DeDouble by proxy.

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
ProxyDeDouble()
          Constructs an instance from no arguments
ProxyDeDouble(DeDouble v)
          Builds a ProxyDeDouble that represents the given a DeDouble.
ProxyDeDouble(double v)
          Builds a ProxyDeDouble that represents the given value.
ProxyDeDouble(java.lang.String v)
          Builds a ProxyDeDouble that represents the given a string representing a double
 
Method Summary
 void addHTML(java.lang.StringBuffer baseString, int i, boolean form)
          Adds the value of the real DeDouble to the HTML text given.
 int compareTo(DataElem o)
          Scores the comparison between the real DeDouble and the given one.
 PersistenceBroker createBroker()
          Creates a broker for the real DeDouble and remember it
 boolean exactMatch(DataElem de)
          Compares the real DeDouble to another.
 java.util.Vector getIndexingFeatures(ProxyDocument source, IndexingModalities im, DataElem field)
          Extract indexing features from the real DeDouble
 double getValue()
          Returns the value of the real DeDouble
 java.lang.String getValueAsString()
          Returns a string representation of the real DeDouble
 int hashCode()
          Redefines the default object.hashCode().
 void HTML_ShowDoc(java.lang.StringBuffer baseString)
          Appends the value to the given string in order to create an HTML doc.
 float match(DataElem de)
          Scores the match of the real DeDouble with another.
 void present()
          Displays the real DeDouble (surrounded with spaces)
 void presentBrief()
          Same as present(), but with no space.
 void setValue(double v)
          Sets the value of the real DeDouble
 java.lang.String toString()
          Returns a string representation of the real DeDouble
 
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

ProxyDeDouble

public ProxyDeDouble()
Constructs an instance from no arguments

ProxyDeDouble

public ProxyDeDouble(DeDouble v)
Builds a ProxyDeDouble that represents the given a DeDouble.
Parameters:
v - the value that the DeDouble will represent.

ProxyDeDouble

public ProxyDeDouble(double v)
Builds a ProxyDeDouble that represents the given value.
Parameters:
v - the value that the DeDouble will represent.

ProxyDeDouble

public ProxyDeDouble(java.lang.String v)
Builds a ProxyDeDouble that represents the given a string representing a double
Parameters:
v - the value that the DeDouble will represent, represented as a string.
Method Detail

getValue

public double getValue()
Returns the value of the real DeDouble
Returns:
the value of the real DeDouble

setValue

public final void setValue(double v)
Sets the value of the real DeDouble
Parameters:
v - the new value the DeDouble represents.

present

public final void present()
Displays the real DeDouble (surrounded with spaces)

presentBrief

public void presentBrief()
Same as present(), but with no space.

match

public float match(DataElem de)
Scores the match of the real DeDouble with another. For the function to succeed, the object must be a DeDouble also.
Parameters:
de - the DeDouble this is compared with.
Returns:
the score of the matching process.

exactMatch

public boolean exactMatch(DataElem de)
Compares the real DeDouble to another. Definition would be ExactMatch(DeDouble) if java allowed it.
Parameters:
de - the DeDouble this is compared with.
Returns:
true if the values are similar,
false otherwise or if de is not a DeDouble.

getIndexingFeatures

public java.util.Vector getIndexingFeatures(ProxyDocument source,
                                            IndexingModalities im,
                                            DataElem field)
Extract indexing features from the real DeDouble
Parameters:
s - source document of data element.
im - the controlling indexing modalities
field - the document field from which the real data element came
Returns:
Vector of indexing features for this.

getValueAsString

public java.lang.String getValueAsString()
Returns a string representation of the real DeDouble
Returns:
string representation of the real DeDouble

toString

public java.lang.String toString()
Returns a string representation of the real DeDouble
Returns:
string representation of the real DeDouble
Overrides:
toString in class VirtualProxy

compareTo

public int compareTo(DataElem o)
Scores the comparison between the real DeDouble and the given one.
Parameters:
o - the DeDouble to compare to.
Returns:
the score as an int. It's the integer part of the difference between the two values. The result is Integer.MAX_VALUE if o2 is not a DeDouble.

hashCode

public int hashCode()
Redefines the default object.hashCode(). The resulting hash code is based on the one of the represented double value.
Returns:
hash code of DeDouble, used for Index, and Hashtable
Overrides:
hashCode in class java.lang.Object
See Also:
Hashtable, Object

addHTML

public void addHTML(java.lang.StringBuffer baseString,
                    int i,
                    boolean form)
Adds the value of the real DeDouble to the HTML text given.
Parameters:
string - the HTML text the value will be appended to.
i - unused.
form - unused.

HTML_ShowDoc

public void HTML_ShowDoc(java.lang.StringBuffer baseString)
Appends the value to the given string in order to create an HTML doc.
Parameters:
baseString - the string which the value is added to.

createBroker

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