es.uned.compiler.intermediate
Class Cuadruple

java.lang.Object
  extended by es.uned.compiler.intermediate.Cuadruple
All Implemented Interfaces:
CuadrupleIF

public class Cuadruple
extends java.lang.Object
implements CuadrupleIF

Clase que representa un cuarteto del código intermedio


Constructor Summary
Cuadruple(java.lang.String operation)
          Constructor for CuadrupleIF.
Cuadruple(java.lang.String operation, OperandIF result)
          Constructor for CuadrupleIF.
Cuadruple(java.lang.String operation, OperandIF result, OperandIF firstOperand)
          Constructor for CuadrupleIF.
Cuadruple(java.lang.String operation, OperandIF result, OperandIF firstOperand, OperandIF secondOperand)
          Constructor for CuadrupleIF.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares this object with another one.
 OperandIF getFirstOperand()
          Returns the firstOperand.
 java.lang.String getOperation()
          Returns the operation.
 OperandIF getResult()
          Returns the result.
 OperandIF getSecondOperand()
          Returns the secondOperand.
 int hashCode()
          Returns a hash code for the object.
 void setFirstOperand(OperandIF firstOperand)
          Sets The firstOperand.
 void setOperation(java.lang.String operation)
          Sets The operation.
 void setResult(OperandIF result)
          Sets The result.
 void setSecondOperand(OperandIF secondOperand)
          Sets The secondOperand.
 java.lang.String toString()
          Return a string representing the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cuadruple

public Cuadruple(java.lang.String operation)
Constructor for CuadrupleIF.

Parameters:
operation - The operation.

Cuadruple

public Cuadruple(java.lang.String operation,
                 OperandIF result)
Constructor for CuadrupleIF.

Parameters:
operation - The operation.
result - The result.

Cuadruple

public Cuadruple(java.lang.String operation,
                 OperandIF result,
                 OperandIF firstOperand)
Constructor for CuadrupleIF.

Parameters:
operation - The operation.
firstOperand - The first operannd.
result - The result.

Cuadruple

public Cuadruple(java.lang.String operation,
                 OperandIF result,
                 OperandIF firstOperand,
                 OperandIF secondOperand)
Constructor for CuadrupleIF.

Parameters:
operation - The operation.
firstOperand - The first operannd.
secondOperand - The second operand.
result - The result.
Method Detail

equals

public boolean equals(java.lang.Object other)
Compares this object with another one.

Overrides:
equals in class java.lang.Object
Parameters:
other - the other object.
Returns:
true if two objects has the same properties.

getFirstOperand

public OperandIF getFirstOperand()
Returns the firstOperand.

Specified by:
getFirstOperand in interface CuadrupleIF
Returns:
Returns the firstOperand.

getOperation

public java.lang.String getOperation()
Returns the operation.

Specified by:
getOperation in interface CuadrupleIF
Returns:
Returns the operation.

getResult

public OperandIF getResult()
Returns the result.

Specified by:
getResult in interface CuadrupleIF
Returns:
Returns the result.

getSecondOperand

public OperandIF getSecondOperand()
Returns the secondOperand.

Specified by:
getSecondOperand in interface CuadrupleIF
Returns:
Returns the secondOperand.

hashCode

public int hashCode()
Returns a hash code for the object.

Overrides:
hashCode in class java.lang.Object

setFirstOperand

public void setFirstOperand(OperandIF firstOperand)
Sets The firstOperand.

Specified by:
setFirstOperand in interface CuadrupleIF
Parameters:
firstOperand - The firstOperand to set.

setOperation

public void setOperation(java.lang.String operation)
Sets The operation.

Specified by:
setOperation in interface CuadrupleIF
Parameters:
operation - The operation to set.

setResult

public void setResult(OperandIF result)
Sets The result.

Specified by:
setResult in interface CuadrupleIF
Parameters:
result - The result to set.

setSecondOperand

public void setSecondOperand(OperandIF secondOperand)
Sets The secondOperand.

Specified by:
setSecondOperand in interface CuadrupleIF
Parameters:
secondOperand - The secondOperand to set.

toString

public java.lang.String toString()
Return a string representing the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representing the object.