at.dms.kjc.slicegraph
Class Slice

java.lang.Object
  extended by at.dms.kjc.slicegraph.Slice
Direct Known Subclasses:
SimpleSlice

public class Slice
extends Object

Slice class models a slice (joiner, sequence of filters, splitter). Beware: slices are linked with Edges, but the back edge of an InputSliceNode and the forward edge of an OutputSliceNode should be null: they are not related to the InterSliceEdge's of the InputSliceNode and OutputSliceNode.

Author:
mgordon

Field Summary
protected  FilterSliceNode[] filterNodes
           
protected  InputSliceNode head
           
protected  int len
           
protected  OutputSliceNode tail
           
 
Constructor Summary
protected Slice()
           
  Slice(InputSliceNode head)
          Create slice with an InputSliceNode.
  Slice(SliceNode node)
          Create slice with a FilterSliceNode.
 
Method Summary
 int finish()
          Finishes creating Slice.
 Slice[] getDependencies()
           
 List<FilterSliceNode> getFilterNodes()
           
 InputSliceNode getHead()
          get the InputSliceNode of the Slice containing this node.
 String getIdent()
          Return a brief string description of this slice.
 int getNumFilters()
           
 OutputSliceNode getTail()
          get the OutputSliceNode of the Slice containing this node.
 void setHead(InputSliceNode node)
          Set the head of this slice to node.
 void setTail(OutputSliceNode out)
          Set the tail of this slice to out.
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

protected InputSliceNode head

tail

protected OutputSliceNode tail

len

protected int len

filterNodes

protected FilterSliceNode[] filterNodes
Constructor Detail

Slice

public Slice(InputSliceNode head)
Create slice with an InputSliceNode. "head" is expected to be linked to a FilterSliceNode by the time finish is called.

Parameters:
head - the InputSliceNode

Slice

public Slice(SliceNode node)
Create slice with a FilterSliceNode. Creates an InputSliceNode automatically and links it with the FilterSliceNode.

Parameters:
node -

Slice

protected Slice()
Method Detail

finish

public int finish()
Finishes creating Slice. Expects the slice to have an InputSliceNode, and 1 or more FilterSliceNodes. Creates an OutputSliceNode if necessary.

Returns:
The number of FilterSliceNodes.

getDependencies

public Slice[] getDependencies()
Returns:
The incoming Slices (Slices) in the partitioned stream graph for this slice (slice).

size

public int size()

setTail

public void setTail(OutputSliceNode out)
Set the tail of this slice to out. This method does not fix the intra-slice connections of the slice nodes, but it does set the parent of the new output slice.

Parameters:
out - The new output slice node.

setHead

public void setHead(InputSliceNode node)
Set the head of this slice to node. This method does not fix the intra-slice connections of the slice nodes, but it does set the parent of the new input slice node.

Parameters:
node - The new input slice node.

getHead

public InputSliceNode getHead()
get the InputSliceNode of the Slice containing this node.

Returns:

getTail

public OutputSliceNode getTail()
get the OutputSliceNode of the Slice containing this node.

Returns:

getIdent

public String getIdent()
Return a brief string description of this slice.

Returns:
a brief string description of this slice.

toString

public String toString()
Overrides:
toString in class Object

getNumFilters

public int getNumFilters()

getFilterNodes

public List<FilterSliceNode> getFilterNodes()
Returns:
list the filter slice nodes, in data flow order, unmodifiable.