Jeospace API

org.jeospace.simulation
Class SimNodeRegistry

java.lang.Object
  extended byorg.jeospace.simulation.SimNodeRegistry

public class SimNodeRegistry
extends java.lang.Object

A factory and catalog (or index) of the available SimNodes and utility methods for constructing the catalog and accessing it's members. The simulation hierarchy is constructed by creating the simulation nodes through this factory.

It should be noted that the hierarchy must be created from the bottom up - from the root (RootNode) through the branches (SystemNode) to the leaves (SatelliteNode).

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton
See Also:
SimNode, ReferenceFrame

Constructor Summary
protected SimNodeRegistry()
          Restricted Constructor
 
Method Summary
 SimNode createNode(KineticBody body)
          Create and add a SimNode to the registry and to it's parent node.
 RootNode createRoot(java.lang.String rootID)
          Create a new root SimNode.
 SatelliteNode createSatelliteNode(Satellite satellite)
          Create and add a SatelliteNode to the registry and to it's parent node.
 SystemNode createSystemNode(World world)
          Create and add an SystemNode to the registry and to it's parent node.
static SimNodeRegistry getInstance()
          Return the instance of the registry
 SimNode getNode(ReferenceFrame refFrame)
          Return the SimNode that cooresponds to the argument.
 SimNode getNode(java.lang.String id)
          Return the SimNode that cooresponds to the argument.
 RootNode getRoot()
          Return the root SimNode.
 SystemNode getSystemNode(ReferenceFrame refFrame)
          Return the SystemNode that cooresponds to the argument.
 boolean removeNode(ChildNode node)
          Remove the argument SimNode from the registry and from the descendant list of it's parent node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimNodeRegistry

protected SimNodeRegistry()
Restricted Constructor

Method Detail

getInstance

public static SimNodeRegistry getInstance()
Return the instance of the registry

Returns:
the instance

getRoot

public RootNode getRoot()
Return the root SimNode.

Returns:
the root SimNode, if one exists, null otherwise.

createRoot

public RootNode createRoot(java.lang.String rootID)
Create a new root SimNode. This will clear all nodes from the registry.

Parameters:
rootID - the unique identifier of the root node. null is considered to be an invlaid value and null will be returned.

getNode

public SimNode getNode(ReferenceFrame refFrame)
Return the SimNode that cooresponds to the argument.

Parameters:
refFrame - A ReferenceFrame identifier of the SimNode to return
Returns:
the referenced SimNode if it exists in the registry, null otherwise

getSystemNode

public SystemNode getSystemNode(ReferenceFrame refFrame)
Return the SystemNode that cooresponds to the argument.

Parameters:
refFrame - A ReferenceFrame identifier of the SystemNode to return
Returns:
the referenced SystemNode if it exists in the registry, null otherwise

getNode

public SimNode getNode(java.lang.String id)
Return the SimNode that cooresponds to the argument.

Parameters:
id - The unique identifier of the SimNode to return
Returns:
the specified SimNode if it exists in the registry, null otherwise

createNode

public SimNode createNode(KineticBody body)
Create and add a SimNode to the registry and to it's parent node.
Note: the hierarchy must be initialized from the root with the 'branches' in place before 'leaf' nodes can be added.

Parameters:
body - the KineticBody to create the node for
Returns:
the SimNode if the node is successfully created, it's parent is found and it has been added to the registry. null if the SimNode cannot be created, there is a system with the same id already registered, or the parent node cannot be found. In the latter circumstance, no change is made to the registery or to the node hierarchy.

createSystemNode

public SystemNode createSystemNode(World world)
Create and add an SystemNode to the registry and to it's parent node.
Note: the hierarchy must be initialized from the root with the 'branches' in place before 'leaf' nodes can be added.

Parameters:
world - the World to create the node for
Returns:
the SystemNode if the node is successfully created, it's parent is found and it has been added to the registry. null if the SystemNode cannot be created, there is a system with the same id already registered, or the parent node cannot be found. In the latter circumstance, no change is made to the registery or to the node hierarchy.

createSatelliteNode

public SatelliteNode createSatelliteNode(Satellite satellite)
Create and add a SatelliteNode to the registry and to it's parent node.
Note: the hierarchy must be initialized from the root with the 'branches' in place before 'leaf' nodes can be added.

Parameters:
satellite - the Satellite to create the node for
Returns:
the SatelliteNode if the node is successfully created, it's parent is found and it has been added to the registry. null if the SatelliteNode cannot be created, there is a node with the same id already registered, or the parent node cannot be found. In the latter circumstance, no change is made to the registery or to the node hierarchy.

removeNode

public boolean removeNode(ChildNode node)
Remove the argument SimNode from the registry and from the descendant list of it's parent node.

Parameters:
node - the SimNode to remove
Returns:
true if the system and it's parent were found and the remove operation processed. false if either the system or it's parent could not be found and the remove operation was not processed.

Jeospace API

Copyright © 2006 - jeospace.org