public interface ProcessorDiagram
Processor
objects into a
connected flow or well-formed sequence of nodes.Modifier and Type | Method and Description |
---|---|
void |
clear()
Deletes all nodes from this diagram.
|
int |
commentCount()
Returns the number of comments in the diagram.
|
java.util.List<Comment> |
comments()
Returns a list of comments in the diagram.
|
Processor |
create(java.lang.String nodeType,
java.lang.String name)
Creates a
Processor of the specified type and adds it to this diagram. |
Processor |
createAt(java.lang.String nodeType,
java.lang.String name,
int x,
int y)
Creates a
Processor of the specified type and adds it to this diagram at the specified
location. |
Comment |
createCommentAt(java.lang.String text,
java.util.List<java.lang.String> nodeIds,
int x,
int y,
int width,
int height)
Creates a
Comment of the specified type and adds it to this diagram at the specified
location. |
CompositeProcessor |
createCompositeAt(java.lang.String label,
java.util.List<Processor> nodes,
java.util.List<Comment> comments,
int x,
int y)
Creates a
CompositeProcessor containing the specified nodes and comments. |
Processor |
createModelApplier(ModelOutput modelOutput,
java.lang.String name)
Creates a
ModelApplier derived from the supplied model output object. |
Processor |
createModelApplierAt(ModelOutput modelOutput,
java.lang.String name,
int x,
int y)
Creates a
ModelApplier derived from the supplied model output object. |
void |
delete(Processor node)
Deletes the specified node from this diagram.
|
void |
deleteAll(java.util.Collection nodes)
Deletes all the specified nodes from this diagram.
|
boolean |
deleteComment(Comment comment)
Deletes the specified comment from this diagram.
|
boolean |
deleteComments(java.util.List<?> comments)
Deletes the specified comments from this diagram.
|
void |
disconnect(Processor node)
Removes any links between the supplied node and any other nodes in this diagram.
|
java.util.List<?> |
expandComposite(CompositeProcessor node)
Expands a
CompositeProcessor into the nodes that make up the composite node. |
java.util.Collection |
findAll(ProcessorFilter filter,
boolean recursive)
Returns a collection of all nodes accepted by the specified filter.
|
java.util.Collection |
findAll(ProcessorType type,
java.lang.String label)
Returns a list of all nodes with the specified type and name.
|
java.util.Collection |
findAll(java.lang.String type,
java.lang.String label)
Returns a list of all nodes with the specified type and name.
|
Processor |
findByID(java.lang.String id)
Returns the node with the supplied ID or
null
if no such node exists. |
Processor |
findByType(java.lang.String type,
java.lang.String label)
Returns the node with the supplied type and/or label.
|
Comment |
findCommentByID(java.lang.String commentId)
Returns the comment with the specified ID from the diagram or
null if no such comment can be found. |
java.util.List |
findDownstream(java.util.List<Processor> fromNodes)
Searches from the supplied list of nodes and returns the set of nodes
downstream of the supplied nodes.
|
Processor |
findProcessorForID(java.lang.String id)
Returns the node with the supplied ID or
null
if no such node exists. |
Processor |
findProcessorForID(java.lang.String id,
boolean recursive)
Returns the node with the supplied ID or
null
if no such node exists. |
java.util.Collection |
findProcessorLabel(java.lang.String label)
Returns a list of all nodes with the specified label.
|
java.util.Collection |
findProcessorType(ProcessorType type)
Returns a list of all nodes with the specified com.spss.psapi.transform.type.
|
java.util.List |
findUpstream(java.util.List<Processor> fromNodes)
Searches from the supplied list of nodes and returns the set of nodes
upstream of the supplied nodes.
|
void |
flushCaches()
Flushes the caches of any cache-enabled
Processor objects
in the diagram. |
int |
getHeight()
Returns the height of the diagram in pixels.
|
int |
getProcessorCount()
Deprecated.
|
ProcessorFactory |
getProcessorFactory()
Returns the
ProcessorFactory for this diagram. |
int |
getWidth()
Returns the width of the diagram in pixels.
|
java.util.List |
insert(ProcessorDiagram source,
java.util.List nodes,
boolean newIDs)
Inserts copies of the nodes in the supplied list.
|
java.util.List |
insert(ProcessorDiagram source,
java.util.List nodes,
java.util.List comments,
boolean newIDs)
Inserts copies of the nodes and comments in the supplied list.
|
boolean |
isEnabled(Processor node)
Returns
true if the supplied node is enabled. |
boolean |
isOwner(Processor node)
Returns
true if the node is owned by this diagram. |
boolean |
isValidLink(Processor source,
Processor target)
Returns
true if it would be valid to create a link between the specified source and target nodes. |
java.util.Iterator |
iterator()
Returns an iterator over the
Processor objects contained in this diagram. |
void |
link(Processor source,
java.util.List targets)
Creates new links between the source and each target node in the supplied
list.
|
void |
link(Processor source,
Processor target)
Creates a new link between the source and the target.
|
void |
linkBetween(Processor inserted,
Processor source,
Processor target)
Connects a
Processor between two other instances and sets the position
of the inserted node to be between those. |
void |
linkPath(java.util.List path)
Creates a new path between
Processor instances. |
void |
linkUpdater(Processor updater,
Processor updatable)
Creates a new update link between the updater and the updatable.
|
Processor |
predecessorAt(Processor node,
int index)
Returns the specified immediate predecessor of the supplied node or
null
if the index is out of bounds |
int |
predecessorCount(Processor node)
Returns the number of immediate predecessors of the supplied node.
|
java.util.List |
predecessors(Processor node)
Returns the immediate predecessors of the supplied node.
|
java.util.Iterator |
processorIterator()
Deprecated.
|
void |
replace(Processor originalNode,
Processor replacementNode,
boolean discardOriginal)
Replaces the specified node from this diagram.
|
void |
setEnabled(Processor node,
boolean enabled)
Sets the enabled state of the supplied node.
|
void |
setSize(int width,
int height)
Sets the size of the diagram.
|
int |
size()
Returns the number of
Processor objects contained in this diagram. |
Processor |
successorAt(Processor node,
int index)
Returns the specified immediate successor of the supplied node or
null
if the index is out of bounds |
int |
successorCount(Processor node)
Returns the number of immediate successors of the supplied node.
|
java.util.List |
successors(Processor node)
Returns the immediate successors of the supplied node.
|
void |
unlink(Processor source,
java.util.List targets)
Removes any direct links between the source and each object in the targets list.
|
void |
unlink(Processor source,
Processor target)
Removes any direct link between the source and the target.
|
void |
unlinkPath(java.util.List path)
Removes any path that exists between
Processor instances. |
void |
unlinkUpdater(Processor updater,
Processor updatable)
Removes any update link between the updater and the updatable.
|
boolean isOwner(Processor node)
true
if the node is owned by this diagram.node
- the nodetrue
if the node is owned by this diagramvoid flushCaches()
Processor
objects
in the diagram. Has no effect if caches are not enabled or are not full.int getProcessorCount()
Processor
objects contained in this diagram.size()
int size()
Processor
objects contained in this diagram.java.util.Iterator processorIterator()
Processor
objects contained in this diagram.
The behaviour of the iterator if the diagram is modified between calls of next()
is undefined.
Note: the iterator returns "top-level" nodes and does not recursively descend into any composite nodes.
iterator()
java.util.Iterator iterator()
Processor
objects contained in this diagram.
The behaviour of the iterator if the diagram is modified between calls of next()
is undefined.
Note: the iterator returns "top-level" nodes and does not recursively descend into any composite nodes.
Processor findByID(java.lang.String id)
null
if no such node exists. The search is limited to the current
diagram.id
- the node IDnull
findByType(String, String)
,
findProcessorForID(String)
,
findProcessorForID(String, boolean)
Processor findByType(java.lang.String type, java.lang.String label)
null
in which case the other parameter is used.
If multiple nodes match then an arbitrary one is chosen and returned.
If no nodes match then the return value is null
.type
- the node typelabel
- the node labelnull
findByID(String)
,
findProcessorLabel(String)
,
findProcessorType(ProcessorType)
java.util.Collection findAll(java.lang.String type, java.lang.String label)
null
in which case the other parameter is
used.type
- the node typelabel
- the node labelfindAll(ProcessorType, String)
,
findByType(String, String)
,
findByID(String)
Processor findProcessorForID(java.lang.String id)
null
if no such node exists. Only searches within the current
diagram i.e. is equivalent to:
findProcessorForID(id, false)
id
- the node IDnull
findProcessorForID(String, boolean)
Processor findProcessorForID(java.lang.String id, boolean recursive)
null
if no such node exists. If the recursive flag is true
then any composite nodes within this diagram are also searched.id
- the node IDrecursive
- if true
then composite nodes should be
recursively searchednull
findProcessorForID(String)
java.util.Collection findProcessorType(ProcessorType type)
type
- the node typefindProcessorLabel(String)
java.util.Collection findProcessorLabel(java.lang.String label)
label
- the node labelfindProcessorType(ProcessorType)
,
PropertiedObject.getLabel()
java.util.Collection findAll(ProcessorType type, java.lang.String label)
type
- the node typelabel
- the node labelfindByType(String, String)
,
findByID(String)
java.util.Collection findAll(ProcessorFilter filter, boolean recursive)
true
then any supernodes within this diagram are also searched.filter
- the node filterrecursive
- if true
then composite nodes should be recursively searchedfindByType(String, String)
,
findByID(String)
void replace(Processor originalNode, Processor replacementNode, boolean discardOriginal) throws OwnerException, ObjectLockedException, InvalidEditException
originalNode
- the node to be replacedreplacementNode
- the new nodediscardOriginal
- if true
, the id of the original node
is assigned to the new node and the original node is automatically
deleted from the diagram. If false
, the original node is
retained and the replacement node id is unchangedOwnerException
- if any node is not owned by this diagramObjectLockedException
- if the diagram is currently lockedInvalidEditException
- is the link operation is invalidvoid delete(Processor node) throws OwnerException, ObjectLockedException
node
- the node to be removedOwnerException
- if the node is not owned
by this diagramObjectLockedException
- if the diagram is currently lockedvoid deleteAll(java.util.Collection nodes) throws OwnerException, ObjectLockedException
nodes
- the collection of nodes to be removedOwnerException
- if any node parameters are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedjava.lang.ClassCastException
- if any item in the collection is not of type Processor
void clear() throws ObjectLockedException
ObjectLockedException
- if the diagram is currently lockedvoid link(Processor source, Processor target) throws OwnerException, ObjectLockedException, InvalidEditException
source
- the source nodetarget
- the target nodeOwnerException
- if any node parameters are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedInvalidEditException
- if the connection would be invalidvoid unlink(Processor source, Processor target) throws OwnerException, ObjectLockedException
source
- the source nodetarget
- the target nodeOwnerException
- if any node parameters are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedvoid link(Processor source, java.util.List targets) throws OwnerException, ObjectLockedException, InvalidEditException
source
- the source nodetargets
- the list of target nodesOwnerException
- if any node parameters are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedInvalidEditException
- if a connection would be invalidjava.lang.ClassCastException
- if targets does not contain instances of Processor
void unlink(Processor source, java.util.List targets) throws OwnerException, ObjectLockedException
source
- the source nodetargets
- the list of target nodesOwnerException
- if any node parameters are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedjava.lang.ClassCastException
- if targets does not contain instances of Processor
void linkPath(java.util.List path) throws OwnerException, ObjectLockedException, InvalidEditException
Processor
instances. The first
node is linked to the second, the second is linked to the third etc.
If any link would be invalid (for example, the nodes are already linked,
the source is a terminal node, the target is a source node or
the target cannot accept any more links), a PredictiveServerException
is thrown and no changes are made to the diagram.path
- the set of Processor
instancesOwnerException
- if any objects in the path are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedInvalidEditException
- if a link between two adjacent nodes in the
path cannot be created.void linkBetween(Processor inserted, Processor source, Processor target) throws OwnerException, ObjectLockedException, InvalidEditException
Processor
between two other instances and sets the position
of the inserted node to be between those. Any direct link between the source and
target is removed first.
If any link would be invalid (the source is a terminal node, the target is a source node or
the target cannot accept any more links), a PredictiveServerException
is thrown and no changes are made to the diagram.inserted
- the node to be insertedsource
- the source nodetarget
- the target nodeOwnerException
- if any of the nodes are not owned by the diagramObjectLockedException
- if the diagram has been locked because of another operationInvalidEditException
- if the edit is invalid e.g., the target already has the maximum number of input connectionsvoid unlinkPath(java.util.List path) throws OwnerException, ObjectLockedException
Processor
instances.
If no link exists between two adjacent nodes in the path, these are silently
ignored i.e., no exception will be thrown.path
- the list of Processor
instancesObjectLockedException
- if the diagram is currently lockedOwnerException
- if any objects in the path are not owned
by this diagramboolean isValidLink(Processor source, Processor target) throws OwnerException
true
if it would be valid to create a link between the specified source and target nodes.
This checks that both objects belong to this diagram, that the source
can supply a link and the target can receive a link, and that creating such a link
will not cause a circularity in the diagram.source
- the source nodetarget
- the target nodetrue
if a link would be valid, false
otherwiseOwnerException
- if the source or target node are not owned
by this diagramvoid disconnect(Processor node) throws OwnerException, ObjectLockedException
node
- the node to be disconnectedOwnerException
- if any objects in the path are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedint successorCount(Processor node) throws OwnerException
node
- the nodeOwnerException
- if the node is not owned by this diagramsuccessorAt(Processor, int)
,
successors(Processor)
java.util.List successors(Processor node) throws OwnerException
node
- the nodeOwnerException
- if the node is not owned by this diagramsuccessorCount(Processor)
,
successorAt(Processor, int)
Processor successorAt(Processor node, int index) throws OwnerException
null
if the index is out of boundsnode
- the successorindex
- which successor to returnnull
OwnerException
- if the node is not owned by this diagramsuccessorCount(Processor)
,
successors(Processor)
int predecessorCount(Processor node) throws OwnerException
node
- the nodeOwnerException
- if the node is not owned by this diagrampredecessorAt(Processor, int)
,
predecessors(Processor)
java.util.List predecessors(Processor node) throws OwnerException
node
- the nodeOwnerException
- if the node is not owned by this diagramProcessor predecessorAt(Processor node, int index) throws OwnerException
null
if the index is out of boundsnode
- the nodeindex
- which predecessor to returnnull
OwnerException
- if the node is not owned by this diagrampredecessorCount(Processor)
,
predecessors(Processor)
boolean isEnabled(Processor node) throws OwnerException
true
if the supplied node is enabled.node
- the nodetrue
if the supplied node is enabledOwnerException
- if the node is not owned by this diagramvoid setEnabled(Processor node, boolean enabled) throws OwnerException
node
- the nodeenabled
- whether the node should be enabledOwnerException
- if the node is not owned by this diagramProcessor create(java.lang.String nodeType, java.lang.String name) throws ObjectCreationException, ObjectLockedException
Processor
of the specified type and adds it to this diagram.nodeType
- the node type namename
- the object's nameProcessor
ObjectCreationException
- if the node cannot be created for some reasonObjectLockedException
- if the node cannot be added to the streamProcessor createAt(java.lang.String nodeType, java.lang.String name, int x, int y) throws ObjectCreationException, ObjectLockedException
Processor
of the specified type and adds it to this diagram at the specified
location. If either x < 0 or y < 0, the location is not set.nodeType
- the node type namename
- the object's namex
- the x locationy
- the y locationProcessor
ObjectCreationException
- if the node cannot be created for some reasonObjectLockedException
- if the node cannot be added to the streamProcessor createModelApplier(ModelOutput modelOutput, java.lang.String name) throws ObjectCreationException, ObjectLockedException
ModelApplier
derived from the supplied model output object.modelOutput
- the model output objectname
- the new object's nameProcessor
ObjectCreationException
- if the node cannot be created for some reasonObjectLockedException
- if the node cannot be added to the streamProcessor createModelApplierAt(ModelOutput modelOutput, java.lang.String name, int x, int y) throws ObjectCreationException, ObjectLockedException
ModelApplier
derived from the supplied model output object.modelOutput
- the model output objectname
- the new object's namex
- the x locationy
- the y locationProcessor
ObjectCreationException
- if the node cannot be created for some reasonObjectLockedException
- if the node cannot be added to the streamProcessorFactory getProcessorFactory()
ProcessorFactory
for this diagram.ProcessorFactory
ProcessorFactory
java.util.List findUpstream(java.util.List<Processor> fromNodes)
fromNodes
- the start point of the searchfindDownstream(List)
java.util.List findDownstream(java.util.List<Processor> fromNodes)
fromNodes
- the start point of the searchfindUpstream(List)
java.util.List insert(ProcessorDiagram source, java.util.List nodes, boolean newIDs) throws ObjectLockedException, InvalidEditException
true
if
the source diagram is the same as this diagram. The method returns the list of
newly inserted nodes where the order of the nodes is undefined (i.e.
the ordering is not necessarily the same as the order of nodes in the input list).
Equivalent to calling:
insert(source, nodes, , newIDs)
source
- the diagram that owns the nodes to be insertednodes
- the nodes to be copiednewIDs
- true
if new IDs should be generated for each node or false
if the existing IDs should be re-usedObjectLockedException
- if the diagram has been locked because of another operationInvalidEditException
- if the edit would be invalidfindUpstream(List)
,
findDownstream(List)
,
insert(ProcessorDiagram, List, boolean)
java.util.List insert(ProcessorDiagram source, java.util.List nodes, java.util.List comments, boolean newIDs) throws ObjectLockedException, InvalidEditException
true
if
the source diagram is the same as this diagram. The method returns the list of
newly inserted objects where the order of the objects is undefined.source
- the diagram that owns the nodes to be insertednodes
- the nodes to be copiedcomments
- the comments to be copiednewIDs
- true
if new IDs should be generated for each node or false
if the existing IDs should be re-usedObjectLockedException
- if the diagram has been locked because of another operationInvalidEditException
- if the edit would be invalidfindUpstream(List)
,
findDownstream(List)
,
insert(ProcessorDiagram, List, boolean)
void linkUpdater(Processor updater, Processor updatable) throws OwnerException, ObjectLockedException, InvalidEditException
Updater
interface while the updatable
implements the Updatable
interface.updater
- the updater nodeupdatable
- the updatable nodeOwnerException
- if any node parameters are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedInvalidEditException
- if the connection would be invalidUpdater
,
Updatable
void unlinkUpdater(Processor updater, Processor updatable) throws OwnerException, ObjectLockedException
Updater
interface while the updatable
implements the Updatable
interface.updater
- the updater nodeupdatable
- the target nodeOwnerException
- if any node parameters are not owned
by this diagramObjectLockedException
- if the diagram is currently lockedUpdater
,
Updatable
int getWidth()
int getHeight()
void setSize(int width, int height)
width
- the width in pixelsheight
- the height in pixelsint commentCount()
java.util.List<Comment> comments()
Comment findCommentByID(java.lang.String commentId)
null
if no such comment can be found.null
Comment createCommentAt(java.lang.String text, java.util.List<java.lang.String> nodeIds, int x, int y, int width, int height) throws ObjectLockedException
Comment
of the specified type and adds it to this diagram at the specified
location. If width or height is <= 0, the default size is used.text
- the initial text in the commentnodeIds
- the listed of associated node IDsx
- the x locationy
- the y locationwidth
- the widthheight
- the heightObjectLockedException
- if the comment cannot be added to the streamboolean deleteComment(Comment comment) throws OwnerException, ObjectLockedException
comment
- the comment to be removedtrue
if the diagram was modified, false
otherwiseOwnerException
- if the comment is not owned by this diagramObjectLockedException
- if the diagram is currently lockedboolean deleteComments(java.util.List<?> comments) throws OwnerException, ObjectLockedException
comments
- the collection of comments to be removedtrue
if the diagram was modified, false
otherwiseOwnerException
- if the node is not owned by this diagramObjectLockedException
- if the diagram is currently lockedjava.lang.ClassCastException
- if any item in the collection is not of type Comment
CompositeProcessor createCompositeAt(java.lang.String label, java.util.List<Processor> nodes, java.util.List<Comment> comments, int x, int y) throws ObjectLockedException, InvalidEditException
CompositeProcessor
containing the specified nodes and comments.
Note that care should be taken to ensure that the set of nodes and comments being encapsulated
is valid since certain errors may not be caught until some changes have already been applied
to the diagram.labels
- the label of the new nodenodes
- the nodes to be encapsulatedcomments
- the comments to be encapsulatedx
- the x locationy
- the y locationObjectLockedException
- if the comment cannot be added to the streamInvalidEditException
- if the specified objects cannot be encapsulatedjava.util.List<?> expandComposite(CompositeProcessor node) throws ObjectLockedException, InvalidEditException
CompositeProcessor
into the nodes that make up the composite node.node
- the composite node to be expandedObjectLockedException
- if the comment cannot be added to the streamInvalidEditException
- if the specified objects cannot be encapsulated(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.