at.dms.kjc.slicegraph
Class SimpleSlice

java.lang.Object
  extended by at.dms.kjc.slicegraph.Slice
      extended by at.dms.kjc.slicegraph.SimpleSlice

public class SimpleSlice
extends Slice

A SimpleSlice is a Slice with exactly one FilterSliceNode.

Author:
dimock

Field Summary
protected  FilterSliceNode body
           
 
Fields inherited from class at.dms.kjc.slicegraph.Slice
filterNodes, head, len, tail
 
Constructor Summary
SimpleSlice(InputSliceNode head)
           
SimpleSlice(InputSliceNode head, FilterSliceNode body, OutputSliceNode tail)
          Constructor: creates a slice with one filter and sets previous parent and next links the supplied InputSliceNode, FilterSliceNode, and OutputSliceNode.
SimpleSlice(SliceNode node)
           
 
Method Summary
 int finish()
          Not needed for SimpleSlice, kept as a sanity check.
 FilterSliceNode getBody()
          Preferred way to access body of a SimpleSlice.
 List<FilterSliceNode> getFilterNodes()
          For SimpleSlice: call getBody() instead.
 int getNumFilters()
          Should not need to be called for SimpleSlice: always 1.
 void setBody(FilterSliceNode body)
          Set the body.
 
Methods inherited from class at.dms.kjc.slicegraph.Slice
getDependencies, getHead, getIdent, getTail, setHead, setTail, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

body

protected FilterSliceNode body
Constructor Detail

SimpleSlice

public SimpleSlice(InputSliceNode head,
                   FilterSliceNode body,
                   OutputSliceNode tail)
Constructor: creates a slice with one filter and sets previous parent and next links the supplied InputSliceNode, FilterSliceNode, and OutputSliceNode.
One of head, body, tail must be non-null. If body is null, then a FilterSliceNode for the body must be reachable from the head or the tail. If head is null and no InputSliceNode is connected to body, then a default InputSliceNode is generated. If tail is null and no OutputSliceNode is connected to body, then a default OutputSliceNode is created.

Parameters:
head - InputSliceNode at head of slice
body - FilterSliceNode in simple slice.
tail - OutputSliceNode at tail of slice.

SimpleSlice

public SimpleSlice(InputSliceNode head)
Parameters:
head -

SimpleSlice

public SimpleSlice(SliceNode node)
Parameters:
node -
Method Detail

finish

public int finish()
Not needed for SimpleSlice, kept as a sanity check.

Overrides:
finish in class Slice
Returns:
The number of FilterSliceNodes.

getNumFilters

public int getNumFilters()
Should not need to be called for SimpleSlice: always 1.

Overrides:
getNumFilters in class Slice

getFilterNodes

public List<FilterSliceNode> getFilterNodes()
For SimpleSlice: call getBody() instead. For compatability with Slice, returns a one-element list of FilterSliceNode.

Overrides:
getFilterNodes in class Slice
Returns:
(singleton) list the filter slice nodes, in data flow order, unmodifiable.

getBody

public FilterSliceNode getBody()
Preferred way to access body of a SimpleSlice.

Returns:
the FilterSliceNode

setBody

public void setBody(FilterSliceNode body)
Set the body. Updates parent pointer in the body, but not the previous or next pointers.

Parameters:
body - a FilterSliceNode.