E
- Type of objects in the collection.public class ProbabilityCollection<E> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ProbabilityCollection.ProbabilitySetElement<T>
Used internally to store information about a object's
state in a collection.
|
Modifier and Type | Field and Description |
---|---|
protected Comparator<ProbabilityCollection.ProbabilitySetElement<E>> |
comparator |
Constructor and Description |
---|
ProbabilityCollection()
Construct a new Probability Collection
|
Modifier and Type | Method and Description |
---|---|
ProbabilityCollection<E> |
add(E object,
int probability)
Add an object to this collection
|
boolean |
contains(E object) |
E |
get() |
E |
get(FastNoiseLite random,
int x,
int z) |
E |
get(Random random) |
int |
getTotalProbability() |
boolean |
isEmpty() |
Iterator<ProbabilityCollection.ProbabilitySetElement<E>> |
iterator() |
boolean |
remove(E object)
Remove a object from this collection
|
int |
size() |
protected final Comparator<ProbabilityCollection.ProbabilitySetElement<E>> comparator
public ProbabilityCollection()
public int size()
public boolean isEmpty()
public boolean contains(E object)
object
- Object to check forpublic Iterator<ProbabilityCollection.ProbabilitySetElement<E>> iterator()
public ProbabilityCollection<E> add(E object, int probability)
object
- Object to addprobability
- sharepublic boolean remove(E object)
object
- Object to removepublic E get()
public E get(FastNoiseLite random, int x, int z)
public final int getTotalProbability()
Copyright © 2020. All rights reserved.