Creates a copy of this WeightedRandom @return An identical copy of this WeightedRandom
()
| 196 | * @return An identical copy of this WeightedRandom |
| 197 | */ |
| 198 | public WeightedRandom<T> clone() { |
| 199 | return new WeightedRandom<T>(new HashMap<>(weights), false); |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * Converts this WeightedRandom to a String which can be deserialized later |