at.dms.kjc.backendSupport
Class MinCodeUnit

java.lang.Object
  extended by at.dms.kjc.backendSupport.MinCodeUnit
All Implemented Interfaces:
SIRCodeUnit
Direct Known Subclasses:
CodeStoreHelper

public class MinCodeUnit
extends Object
implements SIRCodeUnit

Minimum usable implementation of SIRCodeUnit interface.

Author:
dimock

Constructor Summary
MinCodeUnit(JFieldDeclaration[] fields, JMethodDeclaration[] methods)
          Create a new MinCodeUnit.
 
Method Summary
 void addField(JFieldDeclaration field)
          Adds field to this, if field is not already registered as a field of this.
 void addFields(JFieldDeclaration[] fields)
          Adds fields to the end fields of this.
 void addMethod(JMethodDeclaration method)
          Add this method to the end of the methods array.
 void addMethods(JMethodDeclaration[] methods)
          Adds methods to the methods of this if it not already in the methods container.
 JFieldDeclaration[] getFields()
          Return the fields of this unit.
 JMethodDeclaration[] getMethods()
          Return the methods of this unit.
 void setFields(JFieldDeclaration[] fields)
          Set the fields of this to fields, overwriting the old array.
 void setMethods(JMethodDeclaration[] methods)
          Install methods as the new methods array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinCodeUnit

public MinCodeUnit(JFieldDeclaration[] fields,
                   JMethodDeclaration[] methods)
Create a new MinCodeUnit.

Parameters:
fields - Array of field declarations. May be empty if adding later.
methods - Array of method declarations. May be empty if adding later.
Method Detail

addField

public void addField(JFieldDeclaration field)
Description copied from interface: SIRCodeUnit
Adds field to this, if field is not already registered as a field of this.

Specified by:
addField in interface SIRCodeUnit
Parameters:
field - The field to attempt to add.

addFields

public void addFields(JFieldDeclaration[] fields)
Description copied from interface: SIRCodeUnit
Adds fields to the end fields of this. Does not check for duplicates.

Specified by:
addFields in interface SIRCodeUnit
Parameters:
fields - The fields to add to the end.

addMethod

public void addMethod(JMethodDeclaration method)
Description copied from interface: SIRCodeUnit
Add this method to the end of the methods array. Do not check for duplication.

Specified by:
addMethod in interface SIRCodeUnit
Parameters:
method - The method to add.

addMethods

public void addMethods(JMethodDeclaration[] methods)
Description copied from interface: SIRCodeUnit
Adds methods to the methods of this if it not already in the methods container.

Specified by:
addMethods in interface SIRCodeUnit
Parameters:
methods - The methods to attempt to add to the end of the methods.

getFields

public JFieldDeclaration[] getFields()
Description copied from interface: SIRCodeUnit
Return the fields of this unit.

Specified by:
getFields in interface SIRCodeUnit
Returns:
the fields of this unit.

getMethods

public JMethodDeclaration[] getMethods()
Description copied from interface: SIRCodeUnit
Return the methods of this unit.

Specified by:
getMethods in interface SIRCodeUnit
Returns:
the methods of this unit.

setFields

public void setFields(JFieldDeclaration[] fields)
Description copied from interface: SIRCodeUnit
Set the fields of this to fields, overwriting the old array.

Specified by:
setFields in interface SIRCodeUnit
Parameters:
fields - The fields to install.

setMethods

public void setMethods(JMethodDeclaration[] methods)
Description copied from interface: SIRCodeUnit
Install methods as the new methods array. Disregarding the old methods array.

Specified by:
setMethods in interface SIRCodeUnit
Parameters:
methods - The new methods to install.