public final class MutableIdIndexMapping extends IdIndexMapping
Constructor and Description |
---|
MutableIdIndexMapping()
Construct a new empty indexer.
|
Modifier and Type | Method and Description |
---|---|
long |
getId(int idx)
Get the ID for an index.
|
LongList |
getIdList()
Get the list of indexed IDs.
|
IdIndexMapping |
immutableCopy()
Make an immutable copy of this index mapping.
|
int |
internId(long id)
Get an index for an ID, generating a new one if necessary.
|
int |
size()
Get the size of this index.
|
int |
tryGetIndex(long id)
Try to get the index for an ID, returning a negative value if it does not exist.
|
containsId, create, getIndex
public MutableIdIndexMapping()
public long getId(int idx)
IdIndexMapping
getId
in class IdIndexMapping
idx
- The index of the ID to retrieve.public LongList getIdList()
IdIndexMapping
getIdList
in class IdIndexMapping
public int tryGetIndex(long id)
IdIndexMapping
IdIndexMapping.getIndex(long)
, except it returns a negative value
instead of throwing an exception if the id does not exist.tryGetIndex
in class IdIndexMapping
id
- The ID to look for.public int size()
IdIndexMapping
size
in class IdIndexMapping
public int internId(long id)
id
- The ID.public IdIndexMapping immutableCopy()