cad.simcad.worldsimulator.objects
Class ObjectProducer

java.lang.Object
  |
  +--cad.simcad.worldsimulator.objects.ObjectProducer
All Implemented Interfaces:
java.io.Serializable, SimObjectServer

public class ObjectProducer
extends java.lang.Object
implements SimObjectServer, java.io.Serializable

Author:
Charles-Philip Bentley
See Also:
Serialized Form

Constructor Summary
ObjectProducer(SimEnvironment se)
          Creates a new instance of ObjectProducer
 
Method Summary
 SimObject createSimObject(java.lang.String name)
          Creates a new SimObject .
 SimObject createSimObject(java.lang.String name, Owner o, PathPlace pp)
          Creates a new SimObject .
 java.lang.String[] getAllSimObjects()
          Return all the names of SimObject the server knows about.
 java.lang.String[] getAllSimObjects(java.lang.String type)
          Return all the names of SimObject of a certain type the server knows about.
 java.lang.String getClassName(int id)
          Returns the className associated with the id
 java.lang.String getClassName(java.lang.String name)
          Get the ClassName of a given object from its name
 int getId(java.lang.String className)
          Returns the Id associated with the Class name className
 java.lang.String getName(int id)
          Returns the name associated with the id
 java.lang.String getName(java.lang.String className)
          Returns the name associated with the Class name className
 SimEnvironment getSimEnvironment()
          Returns SimEnvironment of the ObjectServer
 java.lang.String[] getSimObjectTypes()
          Return the types of SimObject the server knows about.
 void loadIdToNames()
          Loads the IDs mapped to real Names
 void loadInformation()
           
static void main(java.lang.String[] arg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectProducer

public ObjectProducer(SimEnvironment se)
Creates a new instance of ObjectProducer

Method Detail

getAllSimObjects

public java.lang.String[] getAllSimObjects()
Return all the names of SimObject the server knows about.

Specified by:
getAllSimObjects in interface SimObjectServer
Pre:
-
Returns:
an Array of SimObject
Post:
The Name to be shown to real users is returned

getAllSimObjects

public java.lang.String[] getAllSimObjects(java.lang.String type)
Return all the names of SimObject of a certain type the server knows about.

Specified by:
getAllSimObjects in interface SimObjectServer
Pre:
-
Returns:
an Array of String
Post:
The Name to be shown to real users is returned

getSimObjectTypes

public java.lang.String[] getSimObjectTypes()
Return the types of SimObject the server knows about.

Specified by:
getSimObjectTypes in interface SimObjectServer
Pre:
-
Returns:
an Array of String
Post:
-

loadInformation

public void loadInformation()

loadIdToNames

public void loadIdToNames()
Loads the IDs mapped to real Names


createSimObject

public SimObject createSimObject(java.lang.String name)
Creates a new SimObject .

Specified by:
createSimObject in interface SimObjectServer
Pre:
Name name is known by the ObjectServer
Returns:
the new SimObject. null if name is not known
Post:
A new instance of the SimObject corresponding to the name given in parameters is made and returned to the caller of the method

getClassName

public java.lang.String getClassName(int id)
Returns the className associated with the id

Pre:
-
Returns:
a String.
Post:
the name of the SimObject associated with id is returned

getName

public java.lang.String getName(int id)
Returns the name associated with the id

Specified by:
getName in interface SimObjectServer
Pre:
-
Returns:
a String.
Post:
the name of the SimObject associated with id is returned

getClassName

public java.lang.String getClassName(java.lang.String name)
Get the ClassName of a given object from its name

Specified by:
getClassName in interface SimObjectServer

getName

public java.lang.String getName(java.lang.String className)
Returns the name associated with the Class name className

Specified by:
getName in interface SimObjectServer
Pre:
-
Returns:
a String.
Post:
the name of the SimObject associated with className is returned

getId

public int getId(java.lang.String className)
Returns the Id associated with the Class name className

Specified by:
getId in interface SimObjectServer
Pre:
-
Returns:
an integer value
Post:

createSimObject

public SimObject createSimObject(java.lang.String name,
                                 Owner o,
                                 PathPlace pp)
Description copied from interface: SimObjectServer
Creates a new SimObject .

Specified by:
createSimObject in interface SimObjectServer
Returns:
the new SimObject. null if name is not known

main

public static void main(java.lang.String[] arg)

getSimEnvironment

public SimEnvironment getSimEnvironment()
Description copied from interface: SimObjectServer
Returns SimEnvironment of the ObjectServer

Specified by:
getSimEnvironment in interface SimObjectServer
Returns:
a SimEnvironment.

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be