Class DefaultNodeCreator
- java.lang.Object
-
- repast.simphony.context.space.graph.DefaultNodeCreator
-
- All Implemented Interfaces:
NodeCreator
public class DefaultNodeCreator extends Object implements NodeCreator
Creates an agent / node from a Class. If the Class has a constructor with a single String parameter, the label will be passed in the Constructor.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description DefaultNodeCreator(Class nodeClass)
Creates a DefaultNodeCreator that will create nodes/agents from the specified class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
createNode(String label)
Creates and returns a node to be added to a network via a context.
-
-
-
Constructor Detail
-
DefaultNodeCreator
public DefaultNodeCreator(Class nodeClass)
Creates a DefaultNodeCreator that will create nodes/agents from the specified class.- Parameters:
nodeClass
- the class of the agents /nodes to create
-
-
Method Detail
-
createNode
public Object createNode(String label)
Creates and returns a node to be added to a network via a context.- Specified by:
createNode
in interfaceNodeCreator
- Parameters:
label
- the node label. If the node label does not exist this will be an empty string- Returns:
- the created Node.
-
-