edu.vt.marian.search
Class VectorWtdObjSetEnum

java.lang.Object
  |
  +--edu.vt.marian.search.VectorWtdObjSetEnum

public class VectorWtdObjSetEnum
extends java.lang.Object
implements WtdObjSetEnumeration

A WtdObjSetEnumeration for a VectorWtdObjSet.

JDK Version : 1.1.5

See Also:
WtdObjSetEnumeration, VectorWtdObjSet

Field Summary
protected  java.util.Vector basis
           
protected  int nextElt
           
 
Constructor Summary
VectorWtdObjSetEnum(java.util.Vector v, edu.vt.marian.common.Debug d)
           
 
Method Summary
 int approxNumRemaining()
          Return approximate number of elements left.
 int exactNumRemaining()
          Return exact number of elements remaining in the parent set.
 boolean hasMoreElements()
           
 int maxNumRemaining()
          Return maximum number of elements left.
 java.lang.Object nextElement()
           
 int sample(int num, WtdObjBag sampleBag)
          Copy a certain number of elements into a bag.
 int sampleToWt(edu.vt.marian.common.Weight minWt, WtdObjBag sampleBag)
          Copy into a bag all the members of this set with weights >= some weight.
 void skip(int k)
          Skip forward a certain number of elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

basis

protected java.util.Vector basis

nextElt

protected int nextElt
Constructor Detail

VectorWtdObjSetEnum

public VectorWtdObjSetEnum(java.util.Vector v,
                           edu.vt.marian.common.Debug d)
Method Detail

nextElement

public java.lang.Object nextElement()

hasMoreElements

public boolean hasMoreElements()

skip

public void skip(int k)
Skip forward a certain number of elements.
Specified by:
skip in interface WtdObjSetEnumeration
Parameters:
k - How many elements to skip.
Throws:
java.util.NoSuchElementException -  

sample

public int sample(int num,
                  WtdObjBag sampleBag)
Copy a certain number of elements into a bag.
Specified by:
sample in interface WtdObjSetEnumeration
Parameters:
num - How many elements to copy.
sampleBag - The WtdObjBag to add elements to.
Returns:
OK There were Num elements left, and they all were copied well.
anything else Problems.
Throws:
java.util.NoSuchElementException -  

sampleToWt

public int sampleToWt(edu.vt.marian.common.Weight minWt,
                      WtdObjBag sampleBag)
Copy into a bag all the members of this set with weights >= some weight.
Specified by:
sampleToWt in interface WtdObjSetEnumeration
Parameters:
minWt - The lowest weight to copy.
sampleBag - The WtdObjBag to add elements to.
Returns:
OK There were Num elements left, and they all were copied well.
anything else Problems.
Throws:
java.util.NoSuchElementException -  

exactNumRemaining

public int exactNumRemaining()
Return exact number of elements remaining in the parent set.
Specified by:
exactNumRemaining in interface WtdObjSetEnumeration
Returns:
The exact number of elements still to be enumerated.

approxNumRemaining

public int approxNumRemaining()
Return approximate number of elements left.
Specified by:
approxNumRemaining in interface WtdObjSetEnumeration
Returns:
The approximate number of elements still to be enumerated.

maxNumRemaining

public int maxNumRemaining()
Return maximum number of elements left.
Specified by:
maxNumRemaining in interface WtdObjSetEnumeration
Returns:
The maximum number of elements still to be enumerated.