public class FullMappingsBase extends java.lang.Object implements FullMappings
Constructor and Description |
---|
FullMappingsBase(java.util.List<java.lang.String> unmappedIdentifiers,
java.util.List<java.lang.String> mappedIdentifiers,
Mappings mappings) |
Modifier and Type | Method and Description |
---|---|
int |
getNewId(int id)
Returns the mapped id from the given id, or -1 if invalid/out of bounds.
|
int |
id(java.lang.String identifier)
Returns the unmapped integer id for the given identifier, or -1 if not found.
|
java.lang.String |
identifier(int id)
Returns the unmapped string identifier for the given mapped id.
|
FullMappings |
inverse()
Returns the inverse of the bimappings.
|
int |
mappedId(java.lang.String mappedIdentifier)
Returns the mapped integer id for the given mapped identifier, or -1 if not found.
|
java.lang.String |
mappedIdentifier(int mappedId)
Returns the mapped string identifier for the given mapped id.
|
@Nullable java.lang.String |
mappedIdentifier(java.lang.String identifier)
Returns the mapped string identifier for the given unmapped identifier.
|
int |
mappedSize()
Returns the amount of new ids total, even if it does not have a direct mapping.
|
void |
setNewId(int id,
int mappedId)
Manually maps a specific id.
|
int |
size()
Returns amount of unmapped entries, being the size of the mapping.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
of, of
contains, getNewIdOrDefault
public FullMappingsBase(java.util.List<java.lang.String> unmappedIdentifiers, java.util.List<java.lang.String> mappedIdentifiers, Mappings mappings)
public int id(java.lang.String identifier)
FullMappings
id
in interface FullMappings
identifier
- unmapped string identifierpublic int mappedId(java.lang.String mappedIdentifier)
FullMappings
mappedId
in interface FullMappings
mappedIdentifier
- mapped string identifierpublic java.lang.String identifier(int id)
FullMappings
identifier
in interface FullMappings
id
- unmapped idpublic java.lang.String mappedIdentifier(int mappedId)
FullMappings
mappedIdentifier
in interface FullMappings
mappedId
- mapped idpublic @Nullable java.lang.String mappedIdentifier(java.lang.String identifier)
FullMappings
mappedIdentifier
in interface FullMappings
identifier
- unmapped identifierpublic int getNewId(int id)
Mappings
public void setNewId(int id, int mappedId)
Mappings
public int size()
Mappings
public int mappedSize()
Mappings
mappedSize
in interface Mappings
public FullMappings inverse()
BiMappings
inverse
in interface BiMappings
inverse
in interface FullMappings
inverse
in interface Mappings