org.apache.mahout.math.random
Class WeightedThing<T>
java.lang.Object
org.apache.mahout.math.random.WeightedThing<T>
- All Implemented Interfaces:
- Comparable<WeightedThing<T>>
public final class WeightedThing<T>
- extends Object
- implements Comparable<WeightedThing<T>>
Handy for creating multinomial distributions of things.
WeightedThing
public WeightedThing(T thing,
double weight)
WeightedThing
public WeightedThing(double weight)
getValue
public T getValue()
getWeight
public double getWeight()
setWeight
public void setWeight(double weight)
compareTo
public int compareTo(WeightedThing<T> other)
- Specified by:
compareTo
in interface Comparable<WeightedThing<T>>
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.