RECODER 0.92

recoder.java.reference
Class SpecialConstructorReference

java.lang.Object
  extended by recoder.java.JavaSourceElement
      extended by recoder.java.JavaProgramElement
          extended by recoder.java.JavaNonTerminalProgramElement
              extended by recoder.java.reference.SpecialConstructorReference
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ExpressionContainer, NonTerminalProgramElement, ProgramElement, Reference, ConstructorReference, MemberReference, SourceElement, Statement, ModelElement
Direct Known Subclasses:
SuperConstructorReference, ThisConstructorReference

public abstract class SpecialConstructorReference
extends JavaNonTerminalProgramElement
implements ConstructorReference

Occurs in a constructor declaration as the first statement as this(...) or super(...) reference. The Reference knows the constructor declaration it refers to.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class recoder.java.JavaSourceElement
factory
 
Constructor Summary
  SpecialConstructorReference()
          Special constructor reference.
  SpecialConstructorReference(ASTList<Expression> arguments)
          Special constructor reference.
protected SpecialConstructorReference(SpecialConstructorReference proto)
          Special constructor reference.
 
Method Summary
 ASTList<Expression> getArguments()
          Get arguments.
 NonTerminalProgramElement getASTParent()
          Get AST parent.
 ProgramElement getChildAt(int index)
          Returns the child at the specified index in this node's "virtual" child array
 int getChildCount()
          Returns the number of children of this node.
 Expression getExpressionAt(int index)
           
 int getExpressionCount()
          Get the number of expressions in this container.
 StatementContainer getStatementContainer()
          Get statement container.
 void makeParentRoleValid()
          Make parent role valid.
 boolean replaceChild(ProgramElement p, ProgramElement q)
          Replace a single child in the current node.
 void setArguments(ASTList<Expression> list)
          Set arguments.
 void setStatementContainer(StatementContainer s)
          Set statement container.
 
Methods inherited from class recoder.java.JavaNonTerminalProgramElement
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
 
Methods inherited from class recoder.java.JavaProgramElement
getComments, getID, setComments, validate
 
Methods inherited from class recoder.java.JavaSourceElement
getEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface recoder.java.NonTerminalProgramElement
getChildPositionCode, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
 
Methods inherited from interface recoder.java.Statement
deepClone
 

Constructor Detail

SpecialConstructorReference

public SpecialConstructorReference()
Special constructor reference.


SpecialConstructorReference

public SpecialConstructorReference(ASTList<Expression> arguments)
Special constructor reference.

Parameters:
arguments - an expression mutable list.

SpecialConstructorReference

protected SpecialConstructorReference(SpecialConstructorReference proto)
Special constructor reference.

Parameters:
proto - a special constructor reference.
Method Detail

makeParentRoleValid

public void makeParentRoleValid()
Make parent role valid.

Specified by:
makeParentRoleValid in interface NonTerminalProgramElement
Overrides:
makeParentRoleValid in class JavaNonTerminalProgramElement

getASTParent

public NonTerminalProgramElement getASTParent()
Get AST parent.

Specified by:
getASTParent in interface ProgramElement
Returns:
the non terminal program element.

getStatementContainer

public StatementContainer getStatementContainer()
Get statement container.

Specified by:
getStatementContainer in interface Statement
Returns:
the statement container.

setStatementContainer

public void setStatementContainer(StatementContainer s)
Set statement container.

Specified by:
setStatementContainer in interface Statement
Parameters:
s - a statement container.

getChildCount

public int getChildCount()
Returns the number of children of this node.

Specified by:
getChildCount in interface NonTerminalProgramElement
Returns:
an int giving the number of children of this node

getChildAt

public ProgramElement getChildAt(int index)
Returns the child at the specified index in this node's "virtual" child array

Specified by:
getChildAt in interface NonTerminalProgramElement
Parameters:
index - an index into this node's "virtual" child array
Returns:
the program element at the given position
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is out of bounds

getExpressionCount

public int getExpressionCount()
Get the number of expressions in this container.

Specified by:
getExpressionCount in interface ExpressionContainer
Returns:
the number of expressions.

getExpressionAt

public Expression getExpressionAt(int index)
Specified by:
getExpressionAt in interface ExpressionContainer

replaceChild

public boolean replaceChild(ProgramElement p,
                            ProgramElement q)
Replace a single child in the current node. The child to replace is matched by identity and hence must be known exactly. The replacement element can be null - in that case, the child is effectively removed. The parent role of the new child is validated, while the parent link of the replaced child is left untouched.

Specified by:
replaceChild in interface NonTerminalProgramElement
Parameters:
p - the old child.
p - the new child.
Returns:
true if a replacement has occured, false otherwise.
Throws:
java.lang.ClassCastException - if the new child cannot take over the role of the old one.

getArguments

public ASTList<Expression> getArguments()
Get arguments.

Specified by:
getArguments in interface ConstructorReference
Returns:
the expression mutable list.

setArguments

public void setArguments(ASTList<Expression> list)
Set arguments.

Specified by:
setArguments in interface ConstructorReference
Parameters:
list - an expression mutable list.

RECODER 0.92