## 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.

Constructor Summary
`WeightedThing(double weight)`
`WeightedThing(T thing, double weight)`

Method Summary
`int` `compareTo(WeightedThing<T> other)`
`boolean` `equals(Object o)`
`T` `getValue()`
`double` `getWeight()`
`int` `hashCode()`
`void` `setWeight(double weight)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WeightedThing

    public WeightedThing(T thing,
                         double weight)

### WeightedThing

    public WeightedThing(double weight)

Method Detail

### 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.