|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object urv.util.graph.NetworkGraph<N,W>
public class NetworkGraph<N,W>
This class represents file network in edge-list terms A node list is also stored, necessary for mapping from file to net ids
Constructor Summary | |
---|---|
NetworkGraph()
|
Method Summary | |
---|---|
void |
addEdge(N source,
N target,
Weight weight)
Add a new (directed) Edge to the network structure |
void |
addNode(N node)
Add a new node to network structure This structure will be needed when mapping fileIds into netIds |
boolean |
areLinked(N node1,
N node2)
Checks is node1 has node2 as neighbour or node2 has node1 as neighbour |
boolean |
areNeighbours(N node1,
N node2)
Checks is node1 has node2 has neighbour |
void |
assignWeightToAllEdges(java.lang.Float float1)
|
void |
clear()
Empties the graph, nodes, edges and neighbours |
java.lang.Object |
clone()
|
Edge |
getEdgeBetween(N node1,
N node2)
|
java.util.LinkedList<Edge> |
getEdges()
Return edge list from actual network graph |
java.util.LinkedList<Edge> |
getEdges(N node)
Return edge list where the node n is the source or the target |
java.util.Set<N> |
getLinkedNodes(N node1)
Returns a list of nodes that are in the neighbor list of node1 or that have node1 in their own neighbor list |
java.util.Set<N> |
getNeighbours(N node1)
Returns a list of neighbours of the current node |
int |
getNetworkSize()
Returns the total number of nodes in the network |
java.util.Set<N> |
getNodeList()
Return node list from actual network graph |
java.util.HashSet<N> |
getSubtree(N node1)
Returns all the nodes under the current node (in a directed graph) without the current node |
void |
removeEdge(N src,
N dst,
Weight w)
Removes an edge from the graph |
void |
removeEdges(N node)
Removes edges where the node n is the source or the target. |
void |
removeEdges(N node1,
N node2)
Removes edges that link either node1 to node2 or node2 to node1 |
void |
removeEdgesWithTarget(N node)
Removes edges that have node as target |
void |
removeIsolatedNodes()
|
java.lang.String |
toPajek(java.lang.String fileName,
boolean writeFile)
Method that allows to print the network graph into a pajek file |
java.lang.String |
toString()
Prints the list of nodes and edges |
void |
updateBwOf(OLSRNode node)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NetworkGraph()
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void updateBwOf(OLSRNode node)
updateBwOf
in interface BandwidthUpdatable
public void addEdge(N source, N target, Weight weight)
source
- target
- weight
- public void addNode(N node)
node
- public boolean areLinked(N node1, N node2)
node1
- node2
-
public boolean areNeighbours(N node1, N node2)
node1
- node2
-
public void assignWeightToAllEdges(java.lang.Float float1)
public void clear()
public Edge getEdgeBetween(N node1, N node2)
public java.util.LinkedList<Edge> getEdges()
public java.util.LinkedList<Edge> getEdges(N node)
public java.util.Set<N> getLinkedNodes(N node1)
node1
-
public java.util.Set<N> getNeighbours(N node1)
node1
-
public int getNetworkSize()
public java.util.Set<N> getNodeList()
public java.util.HashSet<N> getSubtree(N node1)
node1
-
public void removeEdge(N src, N dst, Weight w)
src
- dst
- w
- public void removeEdges(N node)
public void removeEdges(N node1, N node2)
public void removeEdgesWithTarget(N node)
node
- public void removeIsolatedNodes()
public java.lang.String toPajek(java.lang.String fileName, boolean writeFile)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |