org.siebengeisslein.pclass
Class BinaryOperator

java.lang.Object
  extended by org.siebengeisslein.client.Persistent
      extended by org.siebengeisslein.pclass.expression.AbstractExpression
          extended by org.siebengeisslein.pclass.BinaryOperator
All Implemented Interfaces:
CommitConstrained, Instrumented, BooleanExpression, CodeFragment, Expression, ExpressionContainer, HasOperator

public class BinaryOperator
extends AbstractExpression
implements ExpressionContainer, HasOperator, BooleanExpression


Constructor Summary
BinaryOperator(ExpressionContainer parent)
           
 
Method Summary
 void checkConstraints()
           
 boolean containsChild(Expression expression)
           
 CodeFragment deleteOperator()
           
 Expression getOperand1()
           
 Expression getOperand2()
           
 POperator getOperator()
           
 PType getResultType()
           
 void onRemove()
           
 void removeChild(Expression expression)
           
 void replaceChild(Expression child, Expression newChild)
           
 void setOperand1(Expression operand1)
           
 void setOperand2(Expression operand2)
           
 void setOperator(POperator operator)
           
 java.lang.String toString(java.lang.String indent)
           
 void visit(org.objectweb.asm.MethodVisitor mv, Frame frame, PClass clazz, boolean forAssignment)
           
 void visitBranch(org.objectweb.asm.MethodVisitor mv, Frame frame, PClass clazz, org.objectweb.asm.Label label)
           
 
Methods inherited from class org.siebengeisslein.pclass.expression.AbstractExpression
getContainer, getDataDirectory, getOwnerClass, getOwnerMethod, getTypeManager, getVariableManager, isAssignable, loadClass, replaceWith, setContainer, toString, visitAssignTo
 
Methods inherited from class org.siebengeisslein.client.Persistent
abort, clearUserLocals, clone, commit, disposeTransient, getGroup, getRef, getTransientValue, hashCode, initTransient, isWriteTransaction, joinWriteTransaction, readLock, setGroup, setTransientValue, toPersistent, toRef, writeExternal, writeLock
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.siebengeisslein.pclass.expression.ExpressionContainer
getDataDirectory, getOwnerClass, getOwnerMethod, getVariableManager
 
Methods inherited from interface org.siebengeisslein.pclass.expression.Expression
getContainer, getVariableManager, isAssignable, replaceWith, setContainer, visitAssignTo
 

Constructor Detail

BinaryOperator

public BinaryOperator(ExpressionContainer parent)
Method Detail

getOperand1

public Expression getOperand1()

setOperand1

public void setOperand1(Expression operand1)

getOperand2

public Expression getOperand2()

setOperand2

public void setOperand2(Expression operand2)

getOperator

public POperator getOperator()
Specified by:
getOperator in interface HasOperator

setOperator

public void setOperator(POperator operator)
Specified by:
setOperator in interface HasOperator

replaceChild

public void replaceChild(Expression child,
                         Expression newChild)
Specified by:
replaceChild in interface ExpressionContainer

removeChild

public void removeChild(Expression expression)
Specified by:
removeChild in interface ExpressionContainer

visit

public void visit(org.objectweb.asm.MethodVisitor mv,
                  Frame frame,
                  PClass clazz,
                  boolean forAssignment)
Specified by:
visit in interface Expression
forAssignment - This indicates that the expression is evaluated to be assigned a value. In this case the last element should not be evaluated (e.g. obj.name should only push obj onto the stack, but to the value of "name".

visitBranch

public void visitBranch(org.objectweb.asm.MethodVisitor mv,
                        Frame frame,
                        PClass clazz,
                        org.objectweb.asm.Label label)
Specified by:
visitBranch in interface BooleanExpression

getResultType

public PType getResultType()
Specified by:
getResultType in interface Expression

deleteOperator

public CodeFragment deleteOperator()
Specified by:
deleteOperator in interface HasOperator

toString

public java.lang.String toString(java.lang.String indent)
Specified by:
toString in interface Expression

containsChild

public boolean containsChild(Expression expression)
Specified by:
containsChild in interface ExpressionContainer

checkConstraints

public void checkConstraints()
                      throws ConstraintViolationException
Specified by:
checkConstraints in interface CommitConstrained
Overrides:
checkConstraints in class AbstractExpression
Throws:
ConstraintViolationException

onRemove

public void onRemove()
Specified by:
onRemove in interface Expression
Overrides:
onRemove in class AbstractExpression