|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpeersim.graph.BitMatrixGraph
public class BitMatrixGraph
This class implements a graph which uses a bitmatrix as inner representation of edges.
| Constructor Summary | |
|---|---|
BitMatrixGraph(int n)
Constructs a directed graph with the given number of nodes. |
|
BitMatrixGraph(int n,
boolean directed)
Constructs an graph with the given number of nodes. |
|
| Method Summary | |
|---|---|
boolean |
clearEdge(int i,
int j)
Removes given edge, returns true if it existed before. |
int |
degree(int i)
Returns the degree of the given node. |
boolean |
directed()
Returns true if the graph is directed otherwise false. |
java.lang.Object |
getEdge(int i,
int j)
Returns null always. |
java.util.Collection<java.lang.Integer> |
getNeighbours(int i)
Returns a collection view to all outgoing edges from i. |
java.lang.Object |
getNode(int i)
Returns null always |
boolean |
isEdge(int i,
int j)
Returns true if there is a directed edge between node i and node j. |
boolean |
setEdge(int i,
int j)
Sets given edge, returns true if it did not exist before. |
int |
size()
The number of nodes in the graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BitMatrixGraph(int n)
n - size of graph
public BitMatrixGraph(int n,
boolean directed)
n - size of graphdirected - if true graph is directed| Method Detail |
|---|
public boolean isEdge(int i,
int j)
Graph
isEdge in interface Graphpublic java.util.Collection<java.lang.Integer> getNeighbours(int i)
Graph
getNeighbours in interface Graphpublic java.lang.Object getNode(int i)
getNode in interface Graph
public java.lang.Object getEdge(int i,
int j)
getEdge in interface Graphpublic int size()
Graph
size in interface Graphpublic boolean directed()
Graph
directed in interface Graph
public boolean setEdge(int i,
int j)
Graph
setEdge in interface Graph
public boolean clearEdge(int i,
int j)
Graph
clearEdge in interface Graphpublic int degree(int i)
Graph
degree in interface Graph
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||