Package repast.simphony.integration
Interface OutputBuilder<X,Y>
-
- All Superinterfaces:
Queryable
- All Known Implementing Classes:
BeanBuilder
,JDOMBuilder
public interface OutputBuilder<X,Y> extends Queryable
Interface representing a type that builds the "output" data read in from a Reader. Implementations of this interface are assumed to be dealing with some sort of hierarchical data and will write to the location they are currently set at. The location is set with thegoRoot()
,goUp()
, andcreateAndGoInto(String)
methods. Initialize must be called before using anOutputBuilder
.- Author:
- Jerry Vos
- See Also:
Reader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description X
createAndGoInto(String name)
Enters into the sub-tree with the specified name, creating the tree (or any values in it) if needed.void
detach()
Detaches the current tree and goes up a level.void
detach(Iterable<X> objsToDetach)
Detaches the specified objects.Y
getWrittenObject()
Retrieves the object (or tree) that has been built with this outputter.void
goRoot()
Goes to the root in the hierarchy.void
goUp()
Goes up a level in the hierarchy.void
initialize()
Initializes the writer for writing.X
writeValue(String name, Object value)
Writes the specifed value using the specified name.-
Methods inherited from interface repast.simphony.integration.Queryable
getRoot, getValue, selectNode, selectNode, selectNodes, selectNodes
-
-
-
-
Method Detail
-
initialize
void initialize()
Initializes the writer for writing.
-
createAndGoInto
X createAndGoInto(String name)
Enters into the sub-tree with the specified name, creating the tree (or any values in it) if needed.- Parameters:
name
- the name of the tree- Returns:
- a detachable object
- See Also:
detach(Iterable)
-
goUp
void goUp()
Goes up a level in the hierarchy.
-
goRoot
void goRoot()
Goes to the root in the hierarchy.
-
writeValue
X writeValue(String name, Object value)
Writes the specifed value using the specified name. What this means is implementation dependent.- Parameters:
name
- the name to write the value undervalue
- the value to write- Returns:
- a detachable object
-
getWrittenObject
Y getWrittenObject()
Retrieves the object (or tree) that has been built with this outputter. This corresponds to the root of the tree, not the current branch.- Returns:
- the object that is a result of the previous writes
-
detach
void detach()
Detaches the current tree and goes up a level.
-
detach
void detach(Iterable<X> objsToDetach)
Detaches the specified objects. These should be return values from thewriteValue(String, Object)
orcreateAndGoInto(java.lang.String)
methods.- Parameters:
objsToDetach
- the objects to detach
-
-