at.dms.kjc.sir
Class SIROperator

java.lang.Object
  extended by at.dms.kjc.sir.SIROperator
All Implemented Interfaces:
DeepCloneable, Finalizable, Serializable
Direct Known Subclasses:
SIRJoiner, SIRSplitter, SIRStream

public abstract class SIROperator
extends Object
implements Finalizable, Serializable, DeepCloneable

This represents an operator in the stream graph.

See Also:
Serialized Form

Constructor Summary
protected SIROperator()
           
protected SIROperator(SIRContainer parent)
          Constructs and operator with parent .
 
Method Summary
abstract  Object accept(AttributeStreamVisitor v)
           
 void assertMutable()
          This should be called in every mutator.
 Object deepClone()
          Returns a deep clone of this object.
protected  void deepCloneInto(SIROperator other)
          Clones all fields of this into
 List<SIROperator> getAncestors()
          Get lists starting with this followed by its ancestors in order of lookup through the parent relation.
abstract  String getIdent()
          Returns an identifier for this which is NOT unique.
 String getName()
          Returns a UNIQUE name for this.
 int getNumber()
          Returns a UNIQUE integer for this.
 SIRContainer getParent()
           
 SIRContainer[] getParents()
          Returns list of all parents.
 JExpression getParentStructureAccess()
          TO BE REMOVED once immutable IR is in place.
 String getRelativeName()
          TO BE REMOVED once immutable stuff is in place.
 String getShortIdent(int n)
          Returns the name of this, truncated to 'n' characters.
 int hashCode()
           
protected  Object readResolve()
           
 void setParent(SIRContainer parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SIROperator

protected SIROperator(SIRContainer parent)
Constructs and operator with parent .


SIROperator

protected SIROperator()
Method Detail

setParent

public void setParent(SIRContainer parent)
Parameters:
parent - the parent to set

getParent

public SIRContainer getParent()
Returns:
the parent

getParents

public SIRContainer[] getParents()
Returns list of all parents. The first element of the list is the immediate parent of this, and the last element is the final non-null ancestor of this.


getAncestors

public List<SIROperator> getAncestors()
Get lists starting with this followed by its ancestors in order of lookup through the parent relation.

Returns:
reflexive closure of parent relation, in order.

getParentStructureAccess

public JExpression getParentStructureAccess()
TO BE REMOVED once immutable IR is in place. Returns an expression that accesses the structure of the parent of this, assuming that the toplevel structure of the last parent is named as in LoweringConstants.getDataField()


getRelativeName

public String getRelativeName()
TO BE REMOVED once immutable stuff is in place.


accept

public abstract Object accept(AttributeStreamVisitor v)

readResolve

protected Object readResolve()
                      throws Exception
Throws:
Exception

getIdent

public abstract String getIdent()
Returns an identifier for this which is NOT unique. This will return the same string for a given type of filter that was added to the stream graph.


getName

public String getName()
Returns a UNIQUE name for this. That is, if a given stream operator was added in multiple positions of the stream graph, then this will return a different name for each instantiation.


getShortIdent

public String getShortIdent(int n)
Returns the name of this, truncated to 'n' characters. If the name overflows, the last three characters will be replaced by ...


getNumber

public int getNumber()
Returns a UNIQUE integer for this. That is, if a given stream operator was added in multiple positions of the stream graph, then this will return a different name for each instantiation.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

assertMutable

public void assertMutable()
This should be called in every mutator.

Specified by:
assertMutable in interface Finalizable

deepClone

public Object deepClone()
Returns a deep clone of this object.

Specified by:
deepClone in interface DeepCloneable

deepCloneInto

protected void deepCloneInto(SIROperator other)
Clones all fields of this into
other