A node in a directed graph of operations. Each node maintains
three pieces of information, in addition to an arbitrary
Object containing user data associated with the node,
in order to allow topological sorting to be performed in linear time.
First, the in-degree (number of other nodes pointing to this
node) is stored as an int. Nodes with in-degree equal to 0 are
"free" and may appear first in a topological sort.
Second, a reference called zeroLink to another
PartialOrderNode is kept in order to allow construction
of a linked list of nodes with zero in-degree.
Third, a Vector of neighboring nodes is maintained
(in no particular order). These are the nodes which are pointed to
by the current node.
This class is used by the implementation of the
OperationRegistry class and is not intended to be part
of the API.
|