galois.objects.graph
Interface IndexedGraph<N extends GObject>

Type Parameters:
N - type of the data contained in a node
All Superinterfaces:
GObject, Graph<N>, Mappable<GNode<N>>
All Known Implementing Classes:
ArrayIndexedTree

public interface IndexedGraph<N extends GObject>
extends Graph<N>

This interface represents a graph that allows programmers to refer to a node's edges by a particular index. An indexed graph is always directed, and does not contain any information on the edges.


Method Summary
 GNode<N> getNeighbor(GNode<N> src, int index)
          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> src, int index, byte flags)
          Get a particular neighbor of a given node
 boolean removeNeighbor(GNode<N> src, int index)
          Remove a particular neighbor of a given node.
 boolean removeNeighbor(GNode<N> src, int index, byte flags)
          Remove a particular neighbor of a given node.
 void setNeighbor(GNode<N> src, GNode<N> dst, int index)
          Set a particular neighbor of a given node.
 void setNeighbor(GNode<N> src, GNode<N> dst, int index, byte flags)
          Set a particular neighbor of a given node.
 
Methods inherited from interface galois.objects.graph.Graph
add, add, addNeighbor, addNeighbor, contains, contains, createNode, createNode, hasNeighbor, hasNeighbor, inNeighborsSize, inNeighborsSize, isDirected, mapInNeighbors, mapInNeighbors, outNeighborsSize, outNeighborsSize, remove, remove, removeNeighbor, removeNeighbor, size, size
 
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

setNeighbor

void setNeighbor(GNode<N> src,
                 GNode<N> dst,
                 int index)
Set a particular neighbor of a given node. All the Galois runtime actions (e.g., conflict detection) will be performed when the method is executed.

Parameters:
src - the node whose neighbor to set
dst - the new neighbor
index - the particular neighbor to set

setNeighbor

void setNeighbor(GNode<N> src,
                 GNode<N> dst,
                 int index,
                 byte flags)
Set a particular neighbor of a given node.

Parameters:
src - the node whose neighbor to set
dst - the new neighbor
flags - Galois runtime actions (e.g., conflict detection) that need to be executed upon invocation of this method. See MethodFlag
index - the particular neighbor to set

getNeighbor

GNode<N> getNeighbor(GNode<N> src,
                     int index)
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.

Parameters:
src - the node whose neighbor to get
index - the particular neighbor to get
Returns:
the neighbor at index

getNeighbor

GNode<N> getNeighbor(GNode<N> src,
                     int index,
                     byte flags)
Get a particular neighbor of a given node

Parameters:
src - the node whose neighbor to get
index - the particular neighbor to get
flags - Galois runtime actions (e.g., conflict detection) that need to be executed upon invocation of this method. See MethodFlag
Returns:
the neighbor at index

removeNeighbor

boolean removeNeighbor(GNode<N> src,
                       int index)
Remove a particular neighbor of a given node. Note that this is equivalent to calling setNeighbor(src, null, index) All the Galois runtime actions (e.g., conflict detection) will be performed when the method is executed.

Parameters:
src - the node whose neighbor to remove
index - the neighbor to remove
Returns:
true if the neighbor was successfully removed

removeNeighbor

boolean removeNeighbor(GNode<N> src,
                       int index,
                       byte flags)
Remove a particular neighbor of a given node. Note that this is equivalent to calling setNeighbor(src, null, index)

Parameters:
src - the node whose neighbor to remove
index - the neighbor to remove
flags - Galois runtime actions (e.g., conflict detection) that need to be executed upon invocation of this method. See MethodFlag
Returns:
true if the neighbor was successfully removed