edu.vt.marian.search
Class MaxUnionSearcher

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

public class MaxUnionSearcher
extends java.lang.Object
implements WtdObjSet

A Searcher that implements the maximizing union operation over WtdObjSets.

See Also:
WtdObjSet, Sequencer, InsertionOrderWtdObjTable

Field Summary
protected  edu.vt.marian.common.Debug debug
           
 
Constructor Summary
MaxUnionSearcher(Sequencer sequencer, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

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

MaxUnionSearcher

public MaxUnionSearcher(Sequencer sequencer,
                        edu.vt.marian.common.Debug d)
Method Detail

elements

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

isEmpty

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

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.

DEVEL***: If we had Sequencer.isElt(), we might be able to do this more efficiently.


exactSize

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

approxSize

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

maxSize

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

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 java.lang.Object

profile

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