neosim.iface
Interface NeosimClasses

All Known Implementing Classes:
NeosimClassesImpl

public interface NeosimClasses


Method Summary
 ClassID addClass(NeosimClass nc)
          Add a class to the registry
 byte[] getByteArray(java.lang.Object o)
          Convert an instance into an array of bytes (object serialization)
 NeosimClass getClassFromID(ClassID cid)
          Return a class from an integer id
 NeosimClass getClassFromName(java.lang.String name)
          Return a class from a name
 ClassID getClassIDFromName(java.lang.String name)
          Return a class id from a name
 java.lang.Object readFromArray(byte[] a)
          Read an object from an array of bytes
 ClassID registerClass(java.lang.String name, java.lang.String parent, java.lang.String pkg)
          Register a class given name, parent, and package.
 

Method Detail

getClassFromID

public NeosimClass getClassFromID(ClassID cid)
Return a class from an integer id
Parameters:
cid - the class id
Returns:
the NeosimClass, or null if an invalid id

getClassFromName

public NeosimClass getClassFromName(java.lang.String name)
Return a class from a name
Parameters:
name - the name of the class
Returns:
the NeosimClass, or null if not found

getClassIDFromName

public ClassID getClassIDFromName(java.lang.String name)
Return a class id from a name
Parameters:
name - the name of the class
Returns:
the ClassID, or -1 if an invalid name

addClass

public ClassID addClass(NeosimClass nc)
Add a class to the registry
Parameters:
nc - the class to add
Returns:
the id of the class

registerClass

public ClassID registerClass(java.lang.String name,
                             java.lang.String parent,
                             java.lang.String pkg)
Register a class given name, parent, and package. e.g. registerClass( "SpikeEvent", "Event", "neosim.kernel" )
Parameters:
name - the name of the class
parent - the name of the parent

getByteArray

public byte[] getByteArray(java.lang.Object o)
Convert an instance into an array of bytes (object serialization)
Parameters:
o - the object to convert
Returns:
the array of bytes

readFromArray

public java.lang.Object readFromArray(byte[] a)
Read an object from an array of bytes
Parameters:
a - the array
Returns:
the object