Class Int2IntMapBiMappings

java.lang.Object
com.viaversion.viaversion.api.data.Int2IntMapBiMappings
All Implemented Interfaces:
BiMappings, Mappings

public class Int2IntMapBiMappings extends Object implements BiMappings
  • Constructor Details

    • Int2IntMapBiMappings

      protected Int2IntMapBiMappings(Int2IntBiMap mappings)
  • Method Details

    • of

      public static Int2IntMapBiMappings of(Int2IntBiMap mappings)
    • 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.
      Specified by:
      getNewId in interface Mappings
      Parameters:
      id - unmapped id
      Returns:
      mapped 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.
      Specified by:
      setNewId in interface Mappings
      Parameters:
      id - unmapped id
      mappedId - mapped id
    • size

      public int size()
      Description copied from interface: Mappings
      Returns amount of unmapped entries, being the size of the mapping.
      Specified by:
      size in interface Mappings
      Returns:
      amount of unmapped entries
    • 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 interface Mappings
      Returns:
      amount of new ids, or -1 if unknown
    • inverse

      public BiMappings inverse()
      Description copied from interface: BiMappings
      Returns the inverse of the bimappings.
      Specified by:
      inverse in interface BiMappings
      Specified by:
      inverse in interface Mappings
      Returns:
      inverse of the bimappings