at.dms.kjc.slicegraph
Class Util

java.lang.Object
  extended by at.dms.kjc.slicegraph.Util

public class Util
extends Object

A class with useful functions that span classes.


Constructor Summary
Util()
           
 
Method Summary
static Iterator<SliceNode> sliceNodeTraversal(List<Slice> slices)
          Get a traversal (linked list iterator) that includes all the slice nodes of the given slice traversal.
static Iterator<SliceNode> sliceNodeTraversal(Slice[] slices)
          Get a traversal (linked list) that includes the head nodes of the given array of slices.
static Edge srcDstToEdge(SliceNode src, SliceNode dst)
          Given two slice nodes, return an edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

sliceNodeTraversal

public static Iterator<SliceNode> sliceNodeTraversal(List<Slice> slices)
Get a traversal (linked list iterator) that includes all the slice nodes of the given slice traversal. Inserting or removing in the returned iterator will not affect the list passed to sliceNodeTraversal. Altering the individual SliceNode's will alter the SliceNode's in the original list.

Parameters:
slices - a list of Slice's.
Returns:
An Iterator over SliceNode's.

sliceNodeTraversal

public static Iterator<SliceNode> sliceNodeTraversal(Slice[] slices)
Get a traversal (linked list) that includes the head nodes of the given array of slices.

Parameters:
slices - an array of Slice's.
Returns:
An Iterator over SliceNodes.

srcDstToEdge

public static Edge srcDstToEdge(SliceNode src,
                                SliceNode dst)
Given two slice nodes, return an edge. Returns an existing edge from src to dst if one is found, else creates a new edge. Only looks at src's edges to find one to return, not at dst's edges. If the edge should be an InterSliceEdge, then the returned edge will be one. Does not update the SliceNode's in any way.

Parameters:
src - Source SliceNode for edge
dst - Destination SliceNode for Edge
Returns:
an InterSliceEdge or Edge from src to dst