TUM CCSM Commons

edu.tum.cs.commons.collections
Class IdManagerBase<K>

java.lang.Object
  extended by edu.tum.cs.commons.collections.IdManagerBase<K>
Direct Known Subclasses:
IdManager, UniqueIdManager

public class IdManagerBase<K>
extends java.lang.Object

Base class for id managers.

Version:
$Rev: 26283 $
Author:
Florian Deissenboeck, $Author: juergens $
Rating:
GREEN Hash: 90DF9C120C62D3E775BE3F45FBA0E008

Constructor Summary
protected IdManagerBase(java.util.Map<K,java.lang.Integer> map)
          Create new id manager
 
Method Summary
 void clear()
          Clear the manager.
 int obtainId(K k)
          Obtain a unique id for an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdManagerBase

protected IdManagerBase(java.util.Map<K,java.lang.Integer> map)
Create new id manager

Parameters:
map - maps from object to ids
Method Detail

obtainId

public int obtainId(K k)
Obtain a unique id for an object. Note that obtaining a id for an object prevents it from being garbage collected.


clear

public void clear()
Clear the manager. Adding an object to the manager, clearing the manager and re-adding the object will not result in the same ids.


TUM CCSM Commons

TUM CCSM Commons - 2.7