Public Member Functions | |
ObjectIdSet (int maxId) | |
ObjectIdSet () | |
synchronized int | getIdFor (Object object) |
synchronized Object | getObjectFor (int id) |
synchronized Object | getObjectAndFreeIdFor (int id) |
Package Attributes | |
TreeMap< Integer, ObjectId > | objectTree = null |
TreeSet< Integer > | objectFreeSet = null |
Classes | |
class | ObjectId |
You store an object in a set and get an integer id back. With this id you can later retrieve the object.
de::gsi::bel::utils::ObjectIdSet::ObjectIdSet | ( | int | maxId | ) | [inline] |
Creates an empty set with a maximum number of entries
maxId | Max number of ids of this set. |
de::gsi::bel::utils::ObjectIdSet::ObjectIdSet | ( | ) | [inline] |
Creates an empty set with a default of max 100 entries.
synchronized int de::gsi::bel::utils::ObjectIdSet::getIdFor | ( | Object | object | ) | [inline] |
Create an id for an object.
object | Object the id is mapped to. |
synchronized Object de::gsi::bel::utils::ObjectIdSet::getObjectAndFreeIdFor | ( | int | id | ) | [inline] |
Get an object corresponding to an id.
id | The id you want to get the object for. |
synchronized Object de::gsi::bel::utils::ObjectIdSet::getObjectFor | ( | int | id | ) | [inline] |
Get an object corresponding to an id.
id | The id you want to get the object for. |