Class Int2IntMapMappings
java.lang.Object
com.viaversion.viaversion.api.data.Int2IntMapMappings
- All Implemented Interfaces:
Mappings
-
Constructor Summary
ModifierConstructorDescriptionprotected
Int2IntMapMappings
(it.unimi.dsi.fastutil.ints.Int2IntMap mappings, int mappedIds) -
Method Summary
Modifier and TypeMethodDescriptionint
getNewId
(int id) Returns the mapped id from the given id, or -1 if invalid/out of bounds.inverse()
Mappings with keys and values swapped.int
Returns the amount of new ids total, even if it does not have a direct mapping.static Int2IntMapMappings
of()
static Int2IntMapMappings
of
(it.unimi.dsi.fastutil.ints.Int2IntMap mappings, int mappedIds) void
setNewId
(int id, int mappedId) Manually maps a specific id.int
size()
Returns amount of unmapped entries, being the size of the mapping.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.viaversion.viaversion.api.data.Mappings
contains, getNewIdOrDefault
-
Constructor Details
-
Int2IntMapMappings
protected Int2IntMapMappings(it.unimi.dsi.fastutil.ints.Int2IntMap mappings, int mappedIds)
-
-
Method Details
-
of
-
of
-
getNewId
public int getNewId(int id) Description copied from interface:Mappings
Returns the mapped id from the given id, or -1 if invalid/out of bounds. -
setNewId
public void setNewId(int id, int mappedId) Description copied from interface:Mappings
Manually maps a specific id. -
size
public int size()Description copied from interface:Mappings
Returns amount of unmapped entries, being the size of the mapping. -
mappedSize
public int mappedSize()Description copied from interface:Mappings
Returns the amount of new ids total, even if it does not have a direct mapping. Returns -1 if unknown.- Specified by:
mappedSize
in interfaceMappings
- Returns:
- amount of new ids, or -1 if unknown
-
inverse
Description copied from interface:Mappings
Mappings with keys and values swapped.
-