Constructor and Description |
---|
Graph() |
Graph(java.util.ArrayList<INode> ln,
java.util.ArrayList<IEdge> le) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(java.util.ArrayList<IEdge> le)
Adds a new list of edges to the graph.
|
void |
addEdge(IEdge e)
Adds a new edge (connecting 2 nodes) to the graph.
|
void |
addNode(java.util.ArrayList<INode> ln)
Adds a new list of nodes to the graph.
|
void |
addNode(INode n)
Adds a new node to the graph.
|
int |
contains(IEdge edge)
Checks if the graph contains a specific edge connecting 2 nodes.
|
int |
contains(INode node)
Checks if the graph contains a specific node.
|
IEdge |
getEdge(int index)
Gets the ith edge.
|
java.util.ArrayList<IEdge> |
getListEdges()
Gets the list of all edges.
|
int |
getListEdgesSize()
Gets the size of the list of all edges.
|
java.util.ArrayList<INode> |
getListNodes()
Gets the list of all nodes.
|
int |
getListNodesSize()
Gets the size of the list of all nodes.
|
INode |
getNode(int index)
Gets the ith node.
|
void |
removeEdge(IEdge e)
Removes an edge from the graph.
|
void |
removeEdge(INode n)
Removes all edges which have a common node at one extremity.
|
void |
removeEdge(int index)
Removes the ith edge from the graph.
|
void |
removeNode(INode n)
Removes a node from the graph.
|
void |
removeNode(int index)
Removes the ith node from the graph.
|
void |
setListNodeAndListEdge(java.util.ArrayList<INode> ln,
java.util.ArrayList<IEdge> le) |
void |
setPositionToAllNodes(int width,
int height)
Sets the position of all nodes in the graph.
|
public void setListNodeAndListEdge(java.util.ArrayList<INode> ln, java.util.ArrayList<IEdge> le)
public void addNode(INode n)
IGraph
public void addNode(java.util.ArrayList<INode> ln)
IGraph
public void removeNode(INode n)
IGraph
removeNode
in interface IGraph
n
- the node in question.public void removeNode(int index)
IGraph
removeNode
in interface IGraph
index
- index.public void addEdge(IEdge e)
IGraph
public void addEdge(java.util.ArrayList<IEdge> le)
IGraph
public void removeEdge(IEdge e)
IGraph
removeEdge
in interface IGraph
e
- the edge in question.public void removeEdge(int index)
IGraph
removeEdge
in interface IGraph
index
- index.public void removeEdge(INode n)
IGraph
removeEdge
in interface IGraph
n
- the common node.public INode getNode(int index)
IGraph
public IEdge getEdge(int index)
IGraph
public java.util.ArrayList<INode> getListNodes()
IGraph
getListNodes
in interface IGraph
public java.util.ArrayList<IEdge> getListEdges()
IGraph
getListEdges
in interface IGraph
public int getListNodesSize()
IGraph
getListNodesSize
in interface IGraph
public int getListEdgesSize()
IGraph
getListEdgesSize
in interface IGraph
public int contains(INode node)
IGraph
public int contains(IEdge edge)
IGraph
public void setPositionToAllNodes(int width, int height)
IGraph
setPositionToAllNodes
in interface IGraph
width
- width of the graph.height
- height of the graph.