gov.nist.nlpir.irf.index.braf
Class ProxyFeatureList

java.lang.Object
  |
  +--gov.nist.nlpir.irf.proxy.VirtualProxy
        |
        +--gov.nist.nlpir.irf.index.braf.ProxyFeatureList

public class ProxyFeatureList
extends VirtualProxy

Proxy class for FeatureLists.

Version:
$Revision: 1.4 $
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
 
Field Summary
private  java.lang.String poolFileName
           
 
Fields inherited from class gov.nist.nlpir.irf.proxy.VirtualProxy
broker, handles, inMemoryProxiesByOid, iS, objectIdentifier, realObject, serialVersionUID
 
Constructor Summary
ProxyFeatureList()
          Creates a ProxyFeatureList with no real object associated.
ProxyFeatureList(java.lang.String poolFileName, int capacity)
          Creates a ProxyFeatureList with the given capacity.
ProxyFeatureList(java.lang.String poolFileName, java.util.Vector theVector)
          Creates a ProxyFeatureList that refers to the given Vector and stores the list in the pool file given.
 
Method Summary
 void addElement(java.lang.Object toAdd)
          Equivalent to the method in Vector.
 PersistenceBroker createBroker()
          The concrete proxy will override this method to get the broker for the proxy object @return the broker for this object
 java.lang.Object elementAt(int range)
          Equivalent to the method in Vector.
 java.util.Enumeration elements()
           
 java.util.Vector getAsVector()
          At the time of the writing of this class, lots of clients were using it as a proxy for a Vector and not for a FeatureList.
 java.util.Vector getDE_Features()
          Returns the value DEs contained in the IndexingFeatures in the list.
 void makeLightweight()
          Like for every other Proxy, this method cuts the link between the real object and the proxy so that the first one can be collected.
 void makePersistent()
          Overriding of the standard method in VirtualProxy
 void replaceRealObject()
          Rewrites the object after it has been changed.
 int size()
          Equivalent to the method in Vector.
 java.lang.String toString()
           
 
Methods inherited from class gov.nist.nlpir.irf.proxy.VirtualProxy
addRefToInMemoryProxiesByOid, deleteRefFromInMemoryProxiesByOid, dematerializeRealObject, dematerializeRealObject, getBroker, getFirstInstance, getInMemoryProxiesByOidBinCount, getInMemoryProxiesByOidSize, getInMemoryProxyCounts, getObjectIdentifier, getPersistenceBroker, getProxyFor, getRealObject, isLightweight, materializeRealObject, presentInMemoryProxies, readExternal, setBroker, setIS, setObjectIdentifier, setRealObject, testInMemoryProxiesByOidTable, writeExternal
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

poolFileName

private transient java.lang.String poolFileName
Constructor Detail

ProxyFeatureList

public ProxyFeatureList()
Creates a ProxyFeatureList with no real object associated. Should only be used by VirtualProxy.getProxyFor() via the newInstance() method.

ProxyFeatureList

public ProxyFeatureList(java.lang.String poolFileName,
                        java.util.Vector theVector)
Creates a ProxyFeatureList that refers to the given Vector and stores the list in the pool file given.

ProxyFeatureList

public ProxyFeatureList(java.lang.String poolFileName,
                        int capacity)
Creates a ProxyFeatureList with the given capacity.
Method Detail

toString

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

addElement

public void addElement(java.lang.Object toAdd)
Equivalent to the method in Vector.
See Also:
Vector.addElement(java.lang.Object)

size

public final int size()
Equivalent to the method in Vector.
See Also:
Vector.size()

elementAt

public final java.lang.Object elementAt(int range)
Equivalent to the method in Vector.
See Also:
Vector.elementAt(int)

createBroker

public PersistenceBroker createBroker()
The concrete proxy will override this method to get the broker for the proxy object @return the broker for this object
Overrides:
createBroker in class VirtualProxy

elements

public final java.util.Enumeration elements()

makePersistent

public void makePersistent()
Overriding of the standard method in VirtualProxy
Overrides:
makePersistent in class VirtualProxy

replaceRealObject

public void replaceRealObject()
Rewrites the object after it has been changed. May never be used, now that put() directly upgrades the storage.
Overrides:
replaceRealObject in class VirtualProxy

getAsVector

public final java.util.Vector getAsVector()
At the time of the writing of this class, lots of clients were using it as a proxy for a Vector and not for a FeatureList. That's why this method remains.

getDE_Features

public final java.util.Vector getDE_Features()
Returns the value DEs contained in the IndexingFeatures in the list. Optimization needed by the IdfIdxIntern.updateSources() method.

makeLightweight

public void makeLightweight()
Like for every other Proxy, this method cuts the link between the real object and the proxy so that the first one can be collected. Here, this method acts the fact that every contained proxy is also made lightweight This way, garbage collection will be faster and, most of all, will happen for every contained proxy, otherwise a reference to a contained proxy may stay around and prevent its real object from being collected.
Overrides:
makeLightweight in class VirtualProxy