edu.vt.marian.search
Interface WtdObjSet

All Known Implementing Classes:
EmptyWtdObjSet, VectorWtdObjSet, SingletonWtdObjSet, MaxUnionSearcher, VectorCacheWtdObjSet, EnumCacheWtdObjSet, ScaledWtdObjSet

public abstract interface WtdObjSet

A Weighted Object Set is a set of MARIAN objects, represented as FullIDs, each of which has associated with it a Weight. The Weights are to be understood relative to each other. Typically, WtdObjSets are formed as the result of some matching operation, so that the different weights within the set imply different strengths of match to a description, or confidence in a proposition, or membership in the set. A Weighted Object Set is always presented in non-increasing Weight order, so that the "best" objects are always returned first.

For convenience, we also consider weighted objects as Java objects in their own right, since we so often need to manipulate an object and a weight together. However, in the one true religion, no Weight has meaning except in relationship to another Weight, and no object weight has significance outside of a WtdObjSet.

See Also:
FullID, Weight, WtdObj, WtdObjSetEnumeration

Method Summary
 int approxSize()
          Return the approximate number of elements in this set (can be cheap and dirty).
 WtdObjSetEnumeration elements()
          Create an Enumeration -- actually a WtdObjSetEnumeration -- 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).
 

Method Detail

elements

public WtdObjSetEnumeration elements()
Create an Enumeration -- actually a WtdObjSetEnumeration -- for this set.

isEmpty

public boolean isEmpty()
Is this set empty?
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?
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.

exactSize

public int exactSize()
Return the exact number of elements in this set (may be costly).

approxSize

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

maxSize

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

toString

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

profile

public java.lang.String profile()
Return a short human-readable string that quickly describes this set.