T
- concrete entity typepublic abstract class ProjectEntityWithIDContainer<T extends ProjectEntityWithID & Comparable<T>> extends ProjectEntityContainer<T>
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,T> |
m_idMap |
m_sequenceProvider
modCount
Constructor and Description |
---|
ProjectEntityWithIDContainer(ProjectFile projectFile)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
getByID(Integer id)
Retrieve an entity by its ID.
|
Integer |
getNextID()
Retrieve the next ID value for this entity.
|
void |
mapID(Integer id,
T entity)
Add an ID to instance mapping.
|
void |
renumberIDs()
This method can be called to ensure that the IDs of all
entities are sequential, and start from an
appropriate point.
|
void |
unmapID(Integer id)
Remove the ID to instance mapping.
|
added, firstUniqueID, fixUniqueIdClashes, getByUniqueID, removed, updateUniqueID
add, add, clear, get, remove, replaced, set, size
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected final Map<Integer,T extends ProjectEntityWithID & Comparable<T>> m_idMap
public ProjectEntityWithIDContainer(ProjectFile projectFile)
projectFile
- parent projectpublic void renumberIDs()
public T getByID(Integer id)
id
- entity IDpublic void unmapID(Integer id)
id
- ID to removepublic void mapID(Integer id, T entity)
id
- IDentity
- instancepublic Integer getNextID()
Copyright © 2000–2024 Packwood Software. All rights reserved.