|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.util.model.Identifier
public class Identifier
The Identifier is a central helper class that can determine the next available ID with respect to a list of Identifiable objects.
Constructor Summary | |
---|---|
Identifier()
|
Method Summary | |
---|---|
static Identifiable |
getIdentifiableWithId(java.util.List identifiables,
int id)
|
static int |
getNextAvailableId(java.util.List listOfIdentifiables)
Takes a List of Identifiable objects, examines each object and determines the next free ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Identifier()
Method Detail |
---|
public static int getNextAvailableId(java.util.List listOfIdentifiables)
This method ensures that IDs are reused. For example, take a List of objects with the following IDs: 1, 2, 3, 4. If the object with ID 2 is deleted and the List is then passed to getNextAvailableId, the ID 2 would be returned, since it is no longer being used by any object in the List.
public static Identifiable getIdentifiableWithId(java.util.List identifiables, int id)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |