com.threerings.cast.bundle.tools
Class ComponentBundlerTask.HashMapIDBroker

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<Tuple<String,String>,Integer>
          extended by com.threerings.cast.bundle.tools.ComponentBundlerTask.HashMapIDBroker
All Implemented Interfaces:
ComponentIDBroker, Serializable, Cloneable, Map<Tuple<String,String>,Integer>
Enclosing class:
ComponentBundlerTask

protected static class ComponentBundlerTask.HashMapIDBroker
extends HashMap<Tuple<String,String>,Integer>
implements ComponentIDBroker

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
protected  int _nextCID
           
protected  int _startCID
           
 
Constructor Summary
protected ComponentBundlerTask.HashMapIDBroker()
           
 
Method Summary
 void commit()
          When the user of a component id broker is done obtaining component ids, it must call this method to give the component id broker an opportunity to flush any newly created component ids back to its persistent store.
 int getComponentID(String cclass, String cname)
          Returns the unique identifier for the named component.
 boolean isModified()
           
 void readFrom(BufferedReader bin)
           
protected  int readInt(BufferedReader bin)
           
 void writeTo(BufferedWriter bout)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

_nextCID

protected int _nextCID

_startCID

protected int _startCID
Constructor Detail

ComponentBundlerTask.HashMapIDBroker

protected ComponentBundlerTask.HashMapIDBroker()
Method Detail

getComponentID

public int getComponentID(String cclass,
                          String cname)
                   throws PersistenceException
Description copied from interface: ComponentIDBroker
Returns the unique identifier for the named component. If no identifier has yet been assigned to the specified named component, one should be assigned and returned.

Specified by:
getComponentID in interface ComponentIDBroker
Parameters:
cclass - the name of the class to which the component belongs.
cname - the name of the component.
Throws:
PersistenceException - thrown if an error occurs communicating with the underlying persistence mechanism used to store the name to id mappings.

commit

public void commit()
            throws PersistenceException
Description copied from interface: ComponentIDBroker
When the user of a component id broker is done obtaining component ids, it must call this method to give the component id broker an opportunity to flush any newly created component ids back to its persistent store.

Specified by:
commit in interface ComponentIDBroker
Throws:
PersistenceException

isModified

public boolean isModified()

writeTo

public void writeTo(BufferedWriter bout)
             throws IOException
Throws:
IOException

readFrom

public void readFrom(BufferedReader bin)
              throws IOException
Throws:
IOException

readInt

protected int readInt(BufferedReader bin)
               throws IOException
Throws:
IOException