public abstract class GraphNode extends Object
Constructor and Description |
---|
GraphNode(GraphNodeObject node)
Creates a new instance of GraphNode
|
Modifier and Type | Method and Description |
---|---|
protected void |
addBackPointer(GraphNode node)
Adds a back pointer to a node in the previous graph layer
|
protected void |
addForwardPointer(GraphNode node)
Adds a forward pointer to a node in the next graph layer
|
static void |
connect(ActionNode action,
LiteralNode literal)
Adds forward and backward pointers to the nodes to connect them in the graph
|
static void |
connect(LiteralNode literal,
ActionNode action)
Adds forward and backward pointers to the nodes to connect them in the graph
|
static void |
connect(LiteralNode literal1,
LiteralNode literal2)
Adds forward and backward pointers to literals that are carried forward in
the graph through maintenance actions (still potentially true at subsequent
literal layers even if they are not explicit postconditions of any action layer
actions
|
static boolean |
contains(List<ActionNode> list,
GraphNode node)
Returns true if an array list contains a node that is equivalent to the parameter
|
boolean |
containsBackPointer(GraphNode node)
Determines whether or not a graph node contains a backpointer to another node
|
boolean |
containsForwardPointer(GraphNode node)
Determines whether or not a graph node contains a backpointer to another node
|
GraphNode |
getBackPointer(int index)
Returns a secified back pointer node
|
GraphNode |
getForwardPointer(int index)
Returns a secified forward pointer node
|
static boolean |
isMutex(GraphNode node1,
GraphNode node2)
Determines whether two GraphNodes are mutually exclusive
|
boolean |
match(GraphNode gNode)
Returns true if a GraphNode parameter is equivalent to this one
|
static boolean |
mutexIsSet(GraphNode node1,
GraphNode node2)
Returns true if two nodes are contained in each other's mutually exclusive lists
|
int |
numBackPointers()
Returns the number of forward pointers
|
int |
numForwardPointers()
Returns the number of forward pointers
|
static void |
setMutex(GraphNode node1,
GraphNode node2)
Adds 2 graph nodes to each other's mutually exclusive lists
|
String |
toString()
Converts the GraphNode to a String
|
public GraphNode(GraphNodeObject node)
node
- protected void addForwardPointer(GraphNode node)
node
- the next layer graph to which the pointer refersprotected void addBackPointer(GraphNode node)
node
- the previous layer graph to which the pointer referspublic int numForwardPointers()
public int numBackPointers()
public GraphNode getForwardPointer(int index)
index
- number of the linkpublic GraphNode getBackPointer(int index)
index
- number of the linkpublic boolean containsForwardPointer(GraphNode node) throws NullPointerException, ClassCastException
node
- node being chec number of the linkNullPointerException
ClassCastException
public boolean containsBackPointer(GraphNode node) throws NullPointerException, ClassCastException
node
- node being chec number of the linkNullPointerException
ClassCastException
public static void connect(LiteralNode literal, ActionNode action)
literal
- literal node that is to be connected as a precondition of an actionaction
- action node that is being assigned a preconditionpublic static void connect(ActionNode action, LiteralNode literal)
action
- action node that is being assigned a postconditionliteral
- literal node that is to be connected as a postcondition of an actionpublic static void connect(LiteralNode literal1, LiteralNode literal2)
literal1
- literal node that needs to be carried forward from layer nliteral2
- literal node that needs to be included in layer n+2public static boolean contains(List<ActionNode> list, GraphNode node)
list
- node
- public boolean match(GraphNode gNode)
gNode
- public static boolean isMutex(GraphNode node1, GraphNode node2)
node1
- node2
- public static void setMutex(GraphNode node1, GraphNode node2)
node1
- node2
- public static boolean mutexIsSet(GraphNode node1, GraphNode node2)
node1
- node2
-