swarm.simtools
Interface UName

All Known Implementing Classes:
UNameImpl

public interface UName
extends SwarmObjectS, SwarmObject

A class used to generate unique names (e.g. "critter1", "critter2" etc.). This class is used to generate unique names (agent0, agent1, agent2...) for objects in a simulation. The user will typically create an instance of the UName class initialized with a baseName presented either as a (const char *) or an object of class String. The user can then request new names, again either as (const char *)'s or as instances of the String class. The user can also reset the counter used to generate the names in case s/he wants to restart naming objects with the same baseName. Note: Both in the case of initialization by (const char *) and initialization by an instance of the String class, the original is copied not stored internally so it is up to the user to free the original (const char *) or String instance if/when necessary!


Method Summary
 String getNewName()
          The getNewName method generates a new name as a character string.
 Object getNewNameObject()
          The getNewNameObject generates a new name as a String Object.
 Object resetCounter()
          Resets the counter used as a suffix in the unique names generated.
 
Methods inherited from interface swarm.objectbase.SwarmObject
getCompleteProbeMap, getProbeForMessage, getProbeForVariable, getProbeMap
 
Methods inherited from interface swarm.defobj.Drop
drop
 
Methods inherited from interface swarm.defobj.DefinedObject
compare, describe, describeID, getDisplayName, getTypeName, getZone, perform, perform$with, perform$with$with, perform$with$with$with, respondsTo, setDisplayName, xfprint, xfprintid, xprint, xprintid
 

Method Detail

getNewName

public String getNewName()
The getNewName method generates a new name as a character string.

getNewNameObject

public Object getNewNameObject()
The getNewNameObject generates a new name as a String Object.

resetCounter

public Object resetCounter()
Resets the counter used as a suffix in the unique names generated.