public class Graph
extends java.lang.Object
implements java.lang.Cloneable
| Constructor and Description |
|---|
Graph()
Constructs a linked list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int id1,
int id2)
Adds a mapping constraint (A, B).
|
void |
clear()
Clears the linked list to the initial state.
|
Graph |
clone()
Clones the linked list.
|
boolean |
contains(int id1,
int id2)
Checks if there is a mapping constraint constraining event id1 and event
id2.
|
int |
edgeSize()
Returns the size of edges.
|
Pair<java.lang.Integer,java.lang.Integer> |
getEdge(int edgeId)
Gets the edge with the given edge ID.
|
java.lang.Iterable<java.lang.Integer> |
getEdges(int nodeId)
Gets the iterator of the edges associated with nodeId.
|
int |
nodeSize()
Return the size of nodes.
|
public Graph clone() throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - the object's class does not implement the Cloneable
interface.public void clear()
public boolean contains(int id1,
int id2)
id1 - ID of the first event.id2 - ID of the second event.public void add(int id1,
int id2)
id1 - ID of event A in the constraintid2 - ID of event B in the constraintpublic java.lang.Iterable<java.lang.Integer> getEdges(int nodeId)
nodeId - ID of the nodepublic int nodeSize()
public int edgeSize()
public Pair<java.lang.Integer,java.lang.Integer> getEdge(int edgeId)
edgeId - the edge Id.