de::gsi::bel::utils::ObjectIdSet Class Reference

List of all members.

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

Detailed Description

A map Object - Integer

You store an object in a set and get an integer id back. With this id you can later retrieve the object.

Author:
huhmann


Constructor & Destructor Documentation

de::gsi::bel::utils::ObjectIdSet::ObjectIdSet ( int  maxId  )  [inline]

Creates an empty set with a maximum number of entries

Parameters:
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.


Member Function Documentation

synchronized int de::gsi::bel::utils::ObjectIdSet::getIdFor ( Object  object  )  [inline]

Create an id for an object.

Parameters:
object Object the id is mapped to.
Returns:
The id which is mapped to object.

synchronized Object de::gsi::bel::utils::ObjectIdSet::getObjectAndFreeIdFor ( int  id  )  [inline]

Get an object corresponding to an id.

Parameters:
id The id you want to get the object for.
Returns:
Object the id was mapped to.

synchronized Object de::gsi::bel::utils::ObjectIdSet::getObjectFor ( int  id  )  [inline]

Get an object corresponding to an id.

Parameters:
id The id you want to get the object for.
Returns:
Object the id was mapped to.


The documentation for this class was generated from the following file:
Generated on 4 Mar 2014 for utilsjava by  doxygen 1.4.7