edu.vt.marian.search
Class VectorCacheWtdObjSet

java.lang.Object
  |
  +--edu.vt.marian.search.VectorWtdObjSet
        |
        +--edu.vt.marian.search.VectorCacheWtdObjSet

public class VectorCacheWtdObjSet
extends VectorWtdObjSet
implements WtdObjSet

A Vector-based cache for any WtdObjSet or WtdObjSet-like object.

See Also:
WtdObjSet, VectorWtdObjSet, VectorCacheWtdObjSetEnum

Field Summary
protected  WtdObjSetEnumeration base
           
 
Fields inherited from class edu.vt.marian.search.VectorWtdObjSet
debug, v
 
Constructor Summary
VectorCacheWtdObjSet(WtdObjSetEnumeration baseEnum, edu.vt.marian.common.Debug d)
           
 
Method Summary
 int approxSize()
          Return the approximate number of elements in this set (can be cheap and dirty).
 WtdObjSetEnumeration elements()
          Create an Enumeration for this set.
 int exactSize()
          Return the exact number of elements in this set (may be costly).
 edu.vt.marian.common.Weight isElt(edu.vt.marian.common.FullID id)
          Is a given ID an element of this set?
 boolean isEmpty()
          Is this set empty?
 int maxSize()
          Return the maximum number of elements in this set (can be cheap and dirty).
 java.lang.String profile()
          Return a short human-readable string that quickly describes this set.
 java.lang.String toString()
          Return a human-readable string for this entire set (may be large).
 
Methods inherited from class edu.vt.marian.search.VectorWtdObjSet
add
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

base

protected WtdObjSetEnumeration base
Constructor Detail

VectorCacheWtdObjSet

public VectorCacheWtdObjSet(WtdObjSetEnumeration baseEnum,
                            edu.vt.marian.common.Debug d)
Method Detail

elements

public WtdObjSetEnumeration elements()
Create an Enumeration for this set.
Specified by:
elements in interface WtdObjSet
Overrides:
elements in class VectorWtdObjSet

isEmpty

public boolean isEmpty()
Is this set empty?
Specified by:
isEmpty in interface WtdObjSet
Returns:
true / false
Overrides:
isEmpty in class VectorWtdObjSet

isElt

public edu.vt.marian.common.Weight isElt(edu.vt.marian.common.FullID id)
Is a given ID an element of this set?
Specified by:
isElt in interface WtdObjSet
Parameters:
id - The (ID of the) element to be tested.
Returns:
null -- the element is not in the set.
any valid Weight -- the element is in the set with that Weight.
Overrides:
isElt in class VectorWtdObjSet

exactSize

public int exactSize()
Return the exact number of elements in this set (may be costly).
Specified by:
exactSize in interface WtdObjSet
Overrides:
exactSize in class VectorWtdObjSet

approxSize

public int approxSize()
Return the approximate number of elements in this set (can be cheap and dirty).
Specified by:
approxSize in interface WtdObjSet
Overrides:
approxSize in class VectorWtdObjSet

maxSize

public int maxSize()
Return the maximum number of elements in this set (can be cheap and dirty).
Specified by:
maxSize in interface WtdObjSet
Overrides:
maxSize in class VectorWtdObjSet

toString

public java.lang.String toString()
Return a human-readable string for this entire set (may be large).
Specified by:
toString in interface WtdObjSet
Overrides:
toString in class VectorWtdObjSet

profile

public java.lang.String profile()
Return a short human-readable string that quickly describes this set.
Specified by:
profile in interface WtdObjSet
Overrides:
profile in class VectorWtdObjSet