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, getIndexpublic MutableIdIndexMapping()
public long getId(int idx)
IdIndexMappinggetId in class IdIndexMappingidx - The index of the ID to retrieve.public LongList getIdList()
IdIndexMappinggetIdList in class IdIndexMappingpublic int tryGetIndex(long id)
IdIndexMappingIdIndexMapping.getIndex(long), except it returns a negative value
instead of throwing an exception if the id does not exist.tryGetIndex in class IdIndexMappingid - The ID to look for.public int size()
IdIndexMappingsize in class IdIndexMappingpublic int internId(long id)
id - The ID.public IdIndexMapping immutableCopy()