uka.util
Class SparseIDMap

java.lang.Object
  extended byuka.util.IDConstants
      extended byuka.util.SparseIDMap
All Implemented Interfaces:
Printable, java.io.Serializable
Direct Known Subclasses:
WeakSparseIDMap

public class SparseIDMap
extends IDConstants
implements java.io.Serializable, Printable

Author:
Bernhard Haumacher
See Also:
Serialized Form

Field Summary
(package private)  IntObjectHashBijection bijection
           
(package private)  IDSpace space
           
 
Fields inherited from class uka.util.IDConstants
FIRST_NEW_ID, FIRST_VALID_ID, INVALID_ID, UNUSED_ID
 
Constructor Summary
SparseIDMap(IDSpace space)
           
 
Method Summary
 void appendTo(ToString s)
          This method should append the contents of each instance variable of the current object to the given ToString object.
 void clear()
           
protected  IntObjectHashBijection createBijection()
           
 void dump()
           
 int findID(java.lang.Object obj)
           
 int getID(java.lang.Object obj)
           
 java.lang.Object getObject(int id)
           
 int getSize()
           
 boolean isUsed(int id)
           
 void remove(int id)
           
 void resetObject(int id, java.lang.Object obj)
           
 void setObject(int id, java.lang.Object obj)
           
 
Methods inherited from class uka.util.IDConstants
isNew, isValid, normalizeID, toggleNew
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

space

IDSpace space

bijection

IntObjectHashBijection bijection
Constructor Detail

SparseIDMap

public SparseIDMap(IDSpace space)
Method Detail

createBijection

protected IntObjectHashBijection createBijection()

getSize

public int getSize()

clear

public void clear()

getID

public int getID(java.lang.Object obj)

findID

public int findID(java.lang.Object obj)

dump

public void dump()

remove

public void remove(int id)

setObject

public void setObject(int id,
                      java.lang.Object obj)

resetObject

public void resetObject(int id,
                        java.lang.Object obj)

isUsed

public final boolean isUsed(int id)

getObject

public java.lang.Object getObject(int id)

appendTo

public void appendTo(ToString s)
Description copied from interface: Printable
This method should append the contents of each instance variable of the current object to the given ToString object. The appended data should be labeled with the name of the corresponding instance variable.

Specified by:
appendTo in interface Printable
See Also:
ToString, ToString.append(String, Object), ToString.append(String, boolean), ToString.append(String, byte), ToString.append(String, int)