T - class of the objects to be contained in this map@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class XYZMap<T extends XYZAddressable>
extends java.lang.Object
implements java.lang.Iterable<T>
XYZAddressable| Constructor and Description |
|---|
XYZMap(float loadFactor,
int capacity)
Creates a new XYZMap with the given load factor and initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from the map.
|
boolean |
contains(int x,
int y,
int z)
Returns true if there exists an entry associated with the given
xyz-coordinates in this map.
|
boolean |
contains(T value)
Returns true if the given value is contained within this map.
|
T |
get(int x,
int y,
int z)
Returns the value associated with the given coordinates or null if no
such value exists.
|
int |
getSize()
Returns the number of elements in this map
|
java.util.Iterator<T> |
iterator() |
T |
put(T value)
Associates the given value with its xyz-coordinates.
|
java.util.Iterator<T> |
randomWrappedIterator(int seed)
Return iterator over elements started from random position defined by
seed
|
T |
remove(int x,
int y,
int z)
Removes and returns the entry associated with the given coordinates.
|
T |
remove(T value)
Removes and returns the given value from this map.
|
public XYZMap(float loadFactor,
int capacity)
loadFactor - the load factorcapacity - the initial capacitypublic int getSize()
public void clear()
@Nullable public T put(T value)
value - value to be associated with its coordinates@Nullable public T remove(int x, int y, int z)
x - the x-coordinatey - the y-coordinatez - the z-coordinate@Nullable public T remove(T value)
value - the value to be removed@Nullable public T get(int x, int y, int z)
x - the x-coordinatey - the y-coordinatez - the z-coordinatepublic boolean contains(int x,
int y,
int z)
x - the x-coordinatey - the z-coordinatez - the y-coordinatepublic boolean contains(T value)
value - the valuepublic java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends XYZAddressable>public java.util.Iterator<T> randomWrappedIterator(int seed)
seed - defines start position