Apply a function on all sub-expressions of this expression and returns a new expression of the same type.
This function should return a value that is of the same class as the object that was given to it.
Should be implemented by all subclasses, but not used directly. Use subexpressions() instead, which is a cached version of this.
Returns a collection that contains all sub-expressions of this expression.
It should not be modified. In practice, it should actually be unmutable or a copy.
Copies the successors of a node matching a status into an array.
Parameters:
node - node.
dest - an array large enough dest.length >= nSucc(node, status).
status - status that must be matched by the nodes.
Returns:
the number of successors matching the status and dest[0,...,nSucc(node, status)-1]
contains the successors in an arbitrary order.
fillSucc
defaultintfillSucc(int node,
int[] dest)
Copies the successors of a node into an array.
Parameters:
node - node.
dest - an array large enough dest.length >= nSucc(node).
Returns:
the number of successors and dest[0,...,nSucc(node)-1]
contains the successors in an arbitrary order.
nSucc
intnSucc(int node)
Returns the number of successors of a node.
Parameters:
node - node.
Returns:
the number of successors matching the status.
fillInsert
intfillInsert(int node,
int[] dest)
Fills an array with the insertions for a node.
Equivalent to fillPred(node, dest, MEMBER).
Parameters:
node - node.
dest - an array large enough dest.length >= nInsert(node).
Returns:
the number of insertions and dest[0,...,nInsert(node)-1]
contains the insertions in an arbitrary order.
nInsert
intnInsert(int node)
Returns the number of insertions of a node.
Parameters:
node - node.
Returns:
the number of insertions of a node.
hasEdge
booleanhasEdge(int from,
int to)
Tells if a directed edge exists between two nodes.
Parameters:
from - origin of the edge.
to - destination of the edge.
Returns:
true if the directed edge exists between two nodes.
hasInsert
booleanhasInsert(int prev,
int node)
Tells if an insertion is valid.
An insert operation is valid iff
- prev is a member node ;
- node is an insertable node (either possible or a required node not yet inserted) ;
- hasEdge(prev, node) ;
- hasEdge(node, memberAfter(prev)).
Parameters:
prev - a member node.
node - an insertable node.
Returns:
true if the node can be inserted after the given member.