edu.cmu.minorthird.classify
Class WeightedSet<T>
java.lang.Object
edu.cmu.minorthird.classify.WeightedSet<T>
- All Implemented Interfaces:
- java.io.Serializable
public class WeightedSet<T>
- extends java.lang.Object
- implements java.io.Serializable
Set of objects, each with an associated weight
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
WeightedSet
public WeightedSet()
add
public boolean add(T object,
double weight)
- Add a new object.
getWeight
public double getWeight(T object,
double defaultWeight)
- Get weight for an object.
getWeight
public double getWeight(T object)
asSet
public java.util.Set<T> asSet()
contains
public boolean contains(T object)
iterator
public java.util.Iterator<T> iterator()
size
public int size()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object