|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgalois.objects.graph.ArrayIndexedTree<N>
N - type of the data contained in a nodepublic final class ArrayIndexedTree<N extends GObject>
Implementation of the IndexedGraph interface.
| Nested Class Summary | |
|---|---|
static class |
ArrayIndexedTree.Builder
A ArrayIndexedTree builder, providing combinations of several features. |
protected class |
ArrayIndexedTree.IndexedTreeNode
|
| Method Summary | ||
|---|---|---|
void |
access(byte flags)
Accesses this object. |
|
boolean |
add(GNode<N> src)
Adds a node to the graph. |
|
boolean |
add(GNode<N> src,
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> src)
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> src,
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. |
|
GNode<N> |
getNeighbor(GNode<N> node,
int idx)
Get a particular neighbor of a given node All the Galois runtime actions (e.g., conflict detection) will be performed when the method is executed. |
|
GNode<N> |
getNeighbor(GNode<N> node,
int idx,
byte flags)
Get a particular neighbor of a given node |
|
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. |
|
|
map(Lambda2Void<GNode<N>,A1> body,
A1 arg1)
Applies a function to each element of this mappable instance serially. |
|
|
map(Lambda2Void<GNode<N>,A1> body,
A1 arg1,
byte flags)
Applies a function to each element of this mappable instance serially. |
|
|
map(Lambda3Void<GNode<N>,A1,A2> body,
A1 arg1,
A2 arg2)
Applies a function to each element of this mappable instance serially. |
|
|
map(Lambda3Void<GNode<N>,A1,A2> body,
A1 arg1,
A2 arg2,
byte flags)
Applies a function to each element of this mappable instance serially. |
|
void |
map(LambdaVoid<GNode<N>> body)
Applies a function to each element of this mappable instance serially. |
|
void |
map(LambdaVoid<GNode<N>> body,
byte flags)
Applies a function to each element of this mappable instance serially. |
|
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>> closure,
byte flags)
Applies the function passed as parameter to every in neighbor of the given node exactly once. |
|
|
mapInternal(Lambda2Void<GNode<N>,A1> body,
MapInternalContext ctx,
A1 arg1)
Applies a function to each element of this mappable instance concurrently. |
|
|
mapInternal(Lambda3Void<GNode<N>,A1,A2> body,
MapInternalContext ctx,
A1 arg1,
A2 arg2)
Applies a function to each element of this mappable instance concurrently. |
|
void |
mapInternal(LambdaVoid<GNode<N>> body,
MapInternalContext ctx)
Applies a function to each element of this mappable instance concurrently. |
|
void |
mapInternalDone()
Signals to instance that concurrent iteration is complete. |
|
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> src)
Removes a node from the graph along with all its outgoing/incoming edges. |
|
boolean |
remove(GNode<N> src,
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. |
|
boolean |
removeNeighbor(GNode<N> node,
int idx)
Remove a particular neighbor of a given node. |
|
boolean |
removeNeighbor(GNode<N> src,
int idx,
byte flags)
Remove a particular neighbor of a given node. |
|
void |
setNeighbor(GNode<N> src,
GNode<N> dst,
int idx)
Set a particular neighbor of a given node. |
|
void |
setNeighbor(GNode<N> src,
GNode<N> dst,
int idx,
byte flags)
Set a particular neighbor of a given node. |
|
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 class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public final GNode<N> createNode(N n)
GraphGraph.add(GNode, byte)),
createNode in interface Graph<N extends GObject>n - data contained in the new node.
public GNode<N> createNode(N n,
byte flags)
GraphGraph.add(GNode, byte)),
createNode in interface Graph<N extends GObject>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
public final boolean add(GNode<N> src)
Graph
add in interface Graph<N extends GObject>src - node created by the current graph
public boolean add(GNode<N> src,
byte flags)
Graph
add in interface Graph<N extends GObject>src - 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
public final boolean remove(GNode<N> src)
Graph
remove in interface Graph<N extends GObject>src - node to be removed
public boolean remove(GNode<N> src,
byte flags)
Graph
remove in interface Graph<N extends GObject>src - node to be removedflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public final boolean contains(GNode<N> src)
Graph
contains in interface Graph<N extends GObject>src - the node to check for
public boolean contains(GNode<N> src,
byte flags)
Graph
contains in interface Graph<N extends GObject>src - the node to check forflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public final int size()
Graph
size in interface Graph<N extends GObject>public int size(byte flags)
Graph
size in interface Graph<N extends GObject>flags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public final boolean addNeighbor(GNode<N> src,
GNode<N> dst)
Graph
addNeighbor in interface Graph<N extends GObject>src - the source of the edgedst - the destination of the edge
public boolean addNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
Graph
addNeighbor in interface Graph<N extends GObject>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
public final boolean removeNeighbor(GNode<N> src,
GNode<N> dst)
Graph
removeNeighbor in interface Graph<N extends GObject>src - the source of the edgedst - the target of the edge
public boolean removeNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
Graph
removeNeighbor in interface Graph<N extends GObject>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
public final boolean hasNeighbor(GNode<N> src,
GNode<N> dst)
Graph
hasNeighbor in interface Graph<N extends GObject>src - the source of the edgedst - the target of the edge
public boolean hasNeighbor(GNode<N> src,
GNode<N> dst,
byte flags)
Graph
hasNeighbor in interface Graph<N extends GObject>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
public final void mapInNeighbors(GNode<N> src,
LambdaVoid<GNode<N>> body)
Graphnode 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.
mapInNeighbors in interface Graph<N extends GObject>src - a node in the graphbody - the function to be applied once to each incoming neighborMappable.map(util.fn.LambdaVoid)
public void mapInNeighbors(GNode<N> src,
LambdaVoid<GNode<N>> closure,
byte flags)
Graphnode 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
mapInNeighbors in interface Graph<N extends GObject>src - a node in the graphclosure - 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 MethodFlagMappable.map(util.fn.LambdaVoid) public final int inNeighborsSize(GNode<N> src)
Graph
inNeighborsSize in interface Graph<N extends GObject>src - a node in the graph
public int inNeighborsSize(GNode<N> src,
byte flags)
Graph
inNeighborsSize in interface Graph<N extends GObject>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
public final int outNeighborsSize(GNode<N> src)
Graph
outNeighborsSize in interface Graph<N extends GObject>src - a node in the graph
public int outNeighborsSize(GNode<N> src,
byte flags)
Graph
outNeighborsSize in interface Graph<N extends GObject>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
public boolean isDirected()
Graph
isDirected in interface Graph<N extends GObject>
public final void setNeighbor(GNode<N> src,
GNode<N> dst,
int idx)
IndexedGraph
setNeighbor in interface IndexedGraph<N extends GObject>src - the node whose neighbor to setdst - the new neighboridx - the particular neighbor to set
public void setNeighbor(GNode<N> src,
GNode<N> dst,
int idx,
byte flags)
IndexedGraph
setNeighbor in interface IndexedGraph<N extends GObject>src - the node whose neighbor to setdst - the new neighboridx - the particular neighbor to setflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public final GNode<N> getNeighbor(GNode<N> node,
int idx)
IndexedGraph
getNeighbor in interface IndexedGraph<N extends GObject>node - the node whose neighbor to getidx - the particular neighbor to get
public GNode<N> getNeighbor(GNode<N> node,
int idx,
byte flags)
IndexedGraph
getNeighbor in interface IndexedGraph<N extends GObject>node - the node whose neighbor to getidx - the particular neighbor to getflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public final boolean removeNeighbor(GNode<N> node,
int idx)
IndexedGraph
removeNeighbor in interface IndexedGraph<N extends GObject>node - the node whose neighbor to removeidx - the neighbor to remove
public boolean removeNeighbor(GNode<N> src,
int idx,
byte flags)
IndexedGraph
removeNeighbor in interface IndexedGraph<N extends GObject>src - the node whose neighbor to removeidx - the neighbor to removeflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public void mapInternal(LambdaVoid<GNode<N>> body,
MapInternalContext ctx)
Mappable
mapInternal in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementGaloisRuntime.foreach(Mappable, LambdaVoid)
public <A1> void mapInternal(Lambda2Void<GNode<N>,A1> body,
MapInternalContext ctx,
A1 arg1)
Mappable
mapInternal in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementarg1 - additional argument to functionGaloisRuntime.foreach(Mappable, Lambda2Void, Object)
public <A1,A2> void mapInternal(Lambda3Void<GNode<N>,A1,A2> body,
MapInternalContext ctx,
A1 arg1,
A2 arg2)
Mappable
mapInternal in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementarg1 - additional argument to functionarg2 - additional argument to functionGaloisRuntime.foreach(Mappable, Lambda3Void, Object, Object)public void map(LambdaVoid<GNode<N>> body)
Mappable
map in interface Mappable<GNode<N extends GObject>>body - function to apply to each element
public void map(LambdaVoid<GNode<N>> body,
byte flags)
Mappable
map in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public <A1> void map(Lambda2Void<GNode<N>,A1> body,
A1 arg1)
Mappable
map in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementarg1 - additional argument to function
public <A1> void map(Lambda2Void<GNode<N>,A1> body,
A1 arg1,
byte flags)
Mappable
map in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementarg1 - argument to functionflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
public <A1,A2> void map(Lambda3Void<GNode<N>,A1,A2> body,
A1 arg1,
A2 arg2)
Mappable
map in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementarg1 - additional argument to functionarg2 - additional argument to function
public <A1,A2> void map(Lambda3Void<GNode<N>,A1,A2> body,
A1 arg1,
A2 arg2,
byte flags)
Mappable
map in interface Mappable<GNode<N extends GObject>>body - function to apply to each elementarg1 - additional argument to functionarg2 - additional argument to functionflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlagpublic void mapInternalDone()
Mappable
mapInternalDone in interface Mappable<GNode<N extends GObject>>public void access(byte flags)
GObject
This method should be called before each access to a Galois object.
Many implementing classes leave this implementation empty and
instead implement conflict detection and rollback for each method
of the object (e.g., GSet, Graph, etc),
which is also known as "boosting".
access in interface GObjectflags - Galois runtime actions (e.g., conflict detection) that need to be executed
upon invocation of this method. See MethodFlag
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||