edu.vt.marian.search
Class EmptyWtdObjSetEnum

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

public class EmptyWtdObjSetEnum
extends java.lang.Object
implements WtdObjSetEnumeration

A WtdObjSetEnumeration for Empty sets, where there is very little to enumerate ;-}.

JDK Version : 1.1.5

See Also:
WtdObjSetEnumeration, EmptyWtdObjSet

Field Summary
protected  edu.vt.marian.common.Debug debug
           
 
Constructor Summary
EmptyWtdObjSetEnum(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

debug

protected edu.vt.marian.common.Debug debug
Constructor Detail

EmptyWtdObjSetEnum

public EmptyWtdObjSetEnum(edu.vt.marian.common.Debug d)
Method Detail

skip

public void skip(int k)
          throws java.util.NoSuchElementException
Skip forward a certain number of elements.
Specified by:
skip in interface WtdObjSetEnumeration
Parameters:
k - How many elements to skip (if other than 0, this surely fails for the empty set!).
Throws:
java.util.NoSuchElementException -  

nextElement

public java.lang.Object nextElement()
                             throws java.util.NoSuchElementException

hasMoreElements

public boolean hasMoreElements()

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.