gov.nist.nlpir.irf.de
Class ProxyDeInteger

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

public class ProxyDeInteger
extends ProxyDataElem

Proxy representation of a integer as a DataElem.

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
ProxyDeInteger()
          No-argument constructor
ProxyDeInteger(DeInteger v)
          Creates a ProxyDeInteger that represents the given integer.
ProxyDeInteger(int v)
          Creates a ProxyDeInteger that represents the given integer.
ProxyDeInteger(java.lang.String v)
          Creates a ProxyDeInteger that represents the given integer.
 
Method Summary
 void addHTML(java.lang.StringBuffer baseString, int i, boolean form)
          Appends the string representation of this to the given HTML text.
Caution: string is modified by this function.
 int compareTo(DataElem o)
          Computes the difference between the real DeInteger and the given DeInteger.
 PersistenceBroker createBroker()
          Creates a broker for this proxy object and remembers it
 boolean exactMatch(DataElem de)
          Compares the values of the real DE_Intger and the given DeInteger and sets the result.
 java.util.Vector getIndexingFeatures(ProxyDocument source, IndexingModalities im, DataElem field)
          Gets the (actually unique) indexing feature of this ProxyDeInteger.
 int getValue()
          Return the value of the represented integer
 java.lang.String getValueAsString()
          Returns a string representation of the integer
 int hashCode()
          Redefines the default Object.hashCode().
 void HTML_ShowDoc(java.lang.StringBuffer baseString)
          Appends a string representation of the real DeInteger to the given string.
 float match(DataElem de)
          Computes the matching score between the real DeInteger and the given DeInteger.
 void present()
          Prints the value of the represented integer.
 void presentBrief()
          Exactly the same thing as present(): prints the value.
 void setValue(int v)
          Sets the value of the represented integer
 java.lang.String toString()
          Returns a string representation of the integer
 
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

ProxyDeInteger

public ProxyDeInteger()
No-argument constructor

ProxyDeInteger

public ProxyDeInteger(DeInteger v)
Creates a ProxyDeInteger that represents the given integer.
Parameters:
v - the value of the represented integer as DeInteger.

ProxyDeInteger

public ProxyDeInteger(int v)
Creates a ProxyDeInteger that represents the given integer.
Parameters:
v - the value of the represented integer.

ProxyDeInteger

public ProxyDeInteger(java.lang.String v)
Creates a ProxyDeInteger that represents the given integer.
Parameters:
v - the value of the integer as a string.
Method Detail

getValue

public final int getValue()
Return the value of the represented integer
Returns:
the value of the represented integer.

setValue

public final void setValue(int v)
Sets the value of the represented integer
Parameters:
v - the new value of the represented integer.

present

public void present()
Prints the value of the represented integer.

presentBrief

public void presentBrief()
Exactly the same thing as present(): prints the value.

getValueAsString

public final java.lang.String getValueAsString()
Returns a string representation of the integer
Returns:
string representation of the integer. Same as getAsString().

toString

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

getIndexingFeatures

public java.util.Vector getIndexingFeatures(ProxyDocument source,
                                            IndexingModalities im,
                                            DataElem field)
Gets the (actually unique) indexing feature of this ProxyDeInteger.
Parameters:
source - the Document in which the integer was read.
im - the controlling indexing modalities
the - document field from which this data element came
Returns:
a vector with one element: an indexing feature

exactMatch

public boolean exactMatch(DataElem de)
Compares the values of the real DE_Intger and the given DeInteger and sets the result.
Parameters:
de - the DeInteger to compare to
Returns:
true if the real DE_Intger and de have the same value,
false otherwise or if de is not a DeInteger.

match

public float match(DataElem de)
Computes the matching score between the real DeInteger and the given DeInteger. Actually, it's 1 if both DeIntegers have the same value, 0 otherwise.
Parameters:
de - the DeInteger this is compared to.
Returns:
1 if this and de have the same value,
0 otherwise.

compareTo

public int compareTo(DataElem o)
Computes the difference between the real DeInteger and the given DeInteger. The result is the mathematically defined difference.
Parameters:
o - the DeInteger this is compared to.
Returns:
the difference between this and compareTo, Integer.MAX_VALUE if compareTo is not a DeInteger.

hashCode

public int hashCode()
Redefines the default Object.hashCode().
Returns:
hash code of DeInteger, 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)
Appends the string representation of this to the given HTML text.
Caution: string is modified by this function.
Parameters:
baseString - the text to be extended by this. Caution: string itself is modified.
i - not used.
form - not used.
Returns:
the new string.

HTML_ShowDoc

public void HTML_ShowDoc(java.lang.StringBuffer baseString)
Appends a string representation of the real DeInteger to the given string.
Parameters:
baseString - the string to be completed.

createBroker

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