|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
N - the type of the data contained in a nodepublic interface Graph<N extends GObject>
Root interface in the graph hierarchy. A graph is a set of nodes connected by edges. Two nodes can be connected by at
most one edge (i.e., this graph is not a multigraph), but self edges are allowed.
This interface supports the storage of data in the nodes of the graph, but not in the edges. Use
ObjectGraph if you need to store values on the edges too.
| Method Summary | |
|---|---|
boolean |
add(GNode<N> n)
Adds a node to the graph. |
boolean |
add(GNode<N> n,
byte flags)
Adds a node to the graph. |
boolean |
addNeighbor(GNode<N> src,
GNode<N> dst)
Adds an edge between the two nodes. |
boolean |
addNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
Adds an edge between the two nodes. |
boolean |
contains(GNode<N> n)
Checks if a node is in the graph All the Galois runtime actions (e.g., conflict detection) will be performed when the method is executed. |
boolean |
contains(GNode<N> n,
byte flags)
Checks if a node is in the graph |
GNode<N> |
createNode(N n)
Creates a new node holding the indicated data. |
GNode<N> |
createNode(N n,
byte flags)
Creates a new node holding the indicated data. |
boolean |
hasNeighbor(GNode<N> src,
GNode<N> dst)
Checks if there is an edge between the two nodes in this graph. |
boolean |
hasNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
Checks if there is an edge between the two nodes in this graph. |
int |
inNeighborsSize(GNode<N> src)
Computes the number of in neighbors of the node, i.e., the number of different vertices that have an outgoing edge that ends at the indicated node. |
int |
inNeighborsSize(GNode<N> src,
byte flags)
Computes the number of in neighbors of the node, i.e., the number of different vertices that have an outgoing edge that ends at the indicated node. |
boolean |
isDirected()
Tests if the current graph is directed. |
void |
mapInNeighbors(GNode<N> src,
LambdaVoid<GNode<N>> body)
Applies the function passed as parameter to every in neighbor of the given node exactly once. |
void |
mapInNeighbors(GNode<N> src,
LambdaVoid<GNode<N>> body,
byte flags)
Applies the function passed as parameter to every in neighbor of the given node exactly once. |
int |
outNeighborsSize(GNode<N> src)
Computes the number of out neighbors of the node, i.e., the number of different vertices that have an incoming edge that starts at the indicated node. |
int |
outNeighborsSize(GNode<N> src,
byte flags)
Computes the number of out neighbors of the node, i.e., the number of different vertices that have an incoming edge that starts at the indicated node. |
boolean |
remove(GNode<N> n)
Removes a node from the graph along with all its outgoing/incoming edges. |
boolean |
remove(GNode<N> n,
byte flags)
Removes a node from the graph along with all its outgoing/incoming edges. |
boolean |
removeNeighbor(GNode<N> src,
GNode<N> dst)
Removes the edge between the two nodes from this graph. |
boolean |
removeNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
Removes the edge between the two nodes from this graph. |
int |
size()
Returns the number of nodes in this graph. |
int |
size(byte flags)
Returns the number of nodes in this graph. |
| Methods inherited from interface galois.objects.Mappable |
|---|
map, map, map, map, map, map, mapInternal, mapInternal, mapInternal, mapInternalDone |
| Methods inherited from interface galois.objects.GObject |
|---|
access |
| Method Detail |
|---|
GNode<N> createNode(N n)
add(GNode, byte)),
n - data contained in the new node.
GNode<N> createNode(N n,
byte flags)
add(GNode, byte)),
n - data contained in the new node.flags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
boolean add(GNode<N> n)
n - node created by the current graph
IllegalArgumentException - if the node has been created by another graph
boolean add(GNode<N> n,
byte flags)
n - node created by the current graphflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
IllegalArgumentException - if the node has been created by another graphboolean remove(GNode<N> n)
n - node to be removed
boolean remove(GNode<N> n,
byte flags)
n - node to be removedflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
boolean contains(GNode<N> n)
n - the node to check for
boolean contains(GNode<N> n,
byte flags)
n - the node to check forflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
int size()
int size(byte flags)
flags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
boolean addNeighbor(GNode<N> src,
GNode<N> dst)
src - the source of the edgedst - the destination of the edge
boolean addNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
src - the source of the edgedst - the destination of the edgeflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
boolean removeNeighbor(GNode<N> src,
GNode<N> dst)
src - the source of the edgedst - the target of the edge
boolean removeNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
src - the source of the edgedst - the target of the edgeflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
boolean hasNeighbor(GNode<N> src,
GNode<N> dst)
src - the source of the edgedst - the target of the edge
boolean hasNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
src - the source of the edgedst - the target of the edgeflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
void mapInNeighbors(GNode<N> src,
LambdaVoid<GNode<N>> body)
node in graph
graph.mapInNeighbors(node, new LambdaVoid<GNode<Integer>>() {
public void call(GNode<Integer> inNeighbor) {
System.out.println(inNeighbor.getData());
}
}
If you wish to apply a function to the out neighbors, please use GNode#map
All the Galois runtime actions (e.g., conflict detection) will be performed when
the method is executed.
src - a node in the graphbody - the function to be applied once to each incoming neighbor
ConcurrentModificationException - if the function modifies the set of in neighbors
of the nodeMappable.map(util.fn.LambdaVoid)
void mapInNeighbors(GNode<N> src,
LambdaVoid<GNode<N>> body,
byte flags)
node in graph
graph.mapInNeighbors(node, new LambdaVoid<GNode<Integer>>() {
public void call(GNode<Integer> inNeighbor) {
System.out.println(inNeighbor.getData());
}
}
If you wish to apply a function to the out neighbors, please use GNode#map
src - a node in the graphbody - the function to be applied once to each incoming neighborflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
ConcurrentModificationException - if the function modifies the set of in neighbors
of the nodeMappable.map(util.fn.LambdaVoid) int inNeighborsSize(GNode<N> src)
src - a node in the graph
int inNeighborsSize(GNode<N> src,
byte flags)
src - a node in the graphflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
int outNeighborsSize(GNode<N> src)
src - a node in the graph
int outNeighborsSize(GNode<N> src,
byte flags)
src - a node in the graphflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
boolean isDirected()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||