Class EnumFacingMap<V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.EnumMap<net.minecraft.core.Direction,V>
org.cyclops.cyclopscore.datastructure.EnumFacingMap<V>
- Type Parameters:
V
- The value type.
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<net.minecraft.core.Direction,
V>
An efficient implementation for mapping facings to any value.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorDescriptionEnumFacingMap
(EnumMap<net.minecraft.core.Direction, ? extends V> m) EnumFacingMap
(Map<net.minecraft.core.Direction, ? extends V> m) -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> EnumFacingMap<V>
forAllValues
(V down, V up, V north, V south, V west, V east) Make a new map for all the given facing values.static <V> EnumFacingMap<V>
newMap()
Make a new empty map.static <V> EnumFacingMap<V>
Copy a map.static <V> EnumFacingMap<V>
Copy a map.Methods inherited from class java.util.EnumMap
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, keySet, put, putAll, remove, size, values
Methods inherited from class java.util.AbstractMap
isEmpty, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
EnumFacingMap
public EnumFacingMap() -
EnumFacingMap
-
EnumFacingMap
-
-
Method Details
-
newMap
Make a new empty map.- Type Parameters:
V
- Value type.- Returns:
- The new map.
-
newMap
Copy a map.- Type Parameters:
V
- Value type.- Parameters:
m
- The existing map.- Returns:
- The new map.
-
newMap
Copy a map.- Type Parameters:
V
- Value type.- Parameters:
m
- The existing map.- Returns:
- The new map.
-
forAllValues
Make a new map for all the given facing values.- Type Parameters:
V
- Value type.- Parameters:
down
- Downup
- Upnorth
- Northsouth
- Southwest
- Westeast
- East- Returns:
- The new map.
-