Modifier and Type | Field and Description |
---|---|
static GraphStructure<Void,Void,Void,Void> |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
Void |
classForNode(Void node)
Finds a node class for
node . |
boolean |
edgeDirect(Void port,
int index)
Checks whether an edge is direct.
|
String |
edgeName(Void port,
int index)
The name of an edge.
|
Collection<? extends Void> |
edgeNodes(Void graph,
Void node,
Void port,
int index)
Nodes where the edges for a port lead to/from.
|
Object |
edgeType(Void port,
int index)
Type of an edge.
|
Void |
graph(Void currentGraph,
Object obj)
Casts
obj to graph, if possible. |
String |
nameTemplate(Void nodeClass)
The template used to build the name of nodes of this class.
|
Void |
node(Object obj)
Finds a node for
obj , if possible. |
Void |
nodeClass(Object obj)
Finds a node class for
obj , if possible. |
Object |
nodeClassType(Void nodeClass)
Java class for a node class.
|
boolean |
nodeHasPredecessor(Void node)
Checks if there is a predecessor for a node.
|
int |
nodeId(Void node)
Id of
node . |
void |
nodeProperties(Void graph,
Void node,
Map<String,? super Object> properties)
Collects node properties.
|
Iterable<? extends Void> |
nodes(Void graph)
Nodes of a graph.
|
int |
nodesCount(Void graph)
Number of nodes in a graph.
|
Void |
portInputs(Void nodeClass)
Input ports of a node class.
|
Void |
portOutputs(Void nodeClass)
Output ports of a node class.
|
int |
portSize(Void port)
The number of edges in a port.
|
public static final GraphStructure<Void,Void,Void,Void> INSTANCE
public Void graph(Void currentGraph, Object obj)
GraphStructure
obj
to graph, if possible. If the given object obj
can be seen as
a graph or sub-graph of a graph, then return the properly typed instance. Otherwise return
null
public Iterable<? extends Void> nodes(Void graph)
GraphStructure
GraphStructure.nodesCount(java.lang.Object)
method.nodes
in interface GraphStructure<Void,Void,Void,Void>
graph
- the graph to query for nodesGraphStructure.nodesCount(java.lang.Object)
public int nodesCount(Void graph)
GraphStructure
GraphStructure.nodes(java.lang.Object)
method.nodesCount
in interface GraphStructure<Void,Void,Void,Void>
graph
- the graph to queryGraphStructure.nodes(java.lang.Object)
public int nodeId(Void node)
GraphStructure
node
. Each node in the graph is uniquely identified by an integer value. If two
nodes have the same id, then they shall be ==
to each other.public boolean nodeHasPredecessor(Void node)
GraphStructure
nodeHasPredecessor
in interface GraphStructure<Void,Void,Void,Void>
node
- the node to checktrue
if it has a predecessor, false
otherwisepublic void nodeProperties(Void graph, Void node, Map<String,? super Object> properties)
GraphStructure
nodeProperties
in interface GraphStructure<Void,Void,Void,Void>
graph
- the current graphnode
- the node to collect properties forproperties
- the map to put the properties topublic Void node(Object obj)
GraphStructure
obj
, if possible. If the given object obj
can be seen
as an instance of node return the properly typed instance of the node class. Otherwise return
null
.public Void nodeClass(Object obj)
GraphStructure
obj
, if possible. If the given object obj
can be
seen as an instance of node class return the properly typed instance of the node class.
Otherwise return null
.public Void classForNode(Void node)
GraphStructure
node
.classForNode
in interface GraphStructure<Void,Void,Void,Void>
node
- an instance of node in this graphnull
public String nameTemplate(Void nodeClass)
GraphStructure
nameTemplate
in interface GraphStructure<Void,Void,Void,Void>
nodeClass
- the node class to find name template forpublic Object nodeClassType(Void nodeClass)
GraphStructure
nodeClassType
in interface GraphStructure<Void,Void,Void,Void>
nodeClass
- the node classClass
or other type representation of the node classpublic Void portInputs(Void nodeClass)
GraphStructure
portInputs
in interface GraphStructure<Void,Void,Void,Void>
nodeClass
- the node classpublic Void portOutputs(Void nodeClass)
GraphStructure
portOutputs
in interface GraphStructure<Void,Void,Void,Void>
nodeClass
- the node classpublic int portSize(Void port)
GraphStructure
GraphStructure.edgeDirect(java.lang.Object, int)
, GraphStructure.edgeName(java.lang.Object, int)
,
GraphStructure.edgeType(java.lang.Object, int)
and
GraphStructure.edgeNodes(java.lang.Object, java.lang.Object, java.lang.Object, int)
for indexes
from 0
to portSize - 1
public boolean edgeDirect(Void port, int index)
GraphStructure
edgeDirect
in interface GraphStructure<Void,Void,Void,Void>
port
- the portindex
- index from 0
to GraphStructure.portSize(java.lang.Object)
minus
1
true
if only one node can be returned from
GraphStructure.edgeNodes(java.lang.Object, java.lang.Object, java.lang.Object, int)
methodpublic String edgeName(Void port, int index)
GraphStructure
edgeName
in interface GraphStructure<Void,Void,Void,Void>
port
- the portindex
- index from 0
to GraphStructure.portSize(java.lang.Object)
minus
1
public Object edgeType(Void port, int index)
GraphStructure
enum- e.g. either real instance of
Enum
subclass, or something that the
GraphOutput.Builder
can recognize as
enum.
edgeType
in interface GraphStructure<Void,Void,Void,Void>
index
- index from 0
to GraphStructure.portSize(java.lang.Object)
minus
1
Enum
representing type of the edgepublic Collection<? extends Void> edgeNodes(Void graph, Void node, Void port, int index)
GraphStructure
direct/non-direct edges
. In case of a direct edge
the returned collection must have exactly one element.edgeNodes
in interface GraphStructure<Void,Void,Void,Void>
graph
- the graphnode
- the node in the graphport
- port of the node classindex
- index from 0
to GraphStructure.portSize(java.lang.Object)
minus
1
null
if there are no edges associated with given port or collection of
nodes where to/from the edges lead to