com.ibm.websphere.samples.technologysamples.ejb.stateless.basiccalculatorwar
Class BasicCalculatorJspBean

java.lang.Object
  extended by com.ibm.websphere.samples.technologysamples.ejb.stateless.basiccalculatorwar.BasicCalculatorJspBean

public class BasicCalculatorJspBean
extends java.lang.Object

Contains getter and setter methods that are used to get information back and forth between the servlet and JSP.


Field Summary
 java.lang.String message
          The message informing users of the error condition encountered
 java.lang.String operand1
          A number to perform this mathematical operation on
 java.lang.String operand2
          Another number to perform this mathematical operation on
 java.lang.String operation
          The mathematical operation to be performed
 java.lang.String result
          The value of the mathematical operation performed
 
Constructor Summary
BasicCalculatorJspBean()
           
 
Method Summary
 java.lang.String getMessage()
          Returns the value of message
 java.lang.String getOperand1()
          Returns the value of the first operand
 java.lang.String getOperand2()
          Returns the value of the second operand
 java.lang.String getOperation()
          Returns the value of the operation as a symbol +, -, *, /
 java.lang.String getResult()
          Returns the value of result (from the mathematical operation performed)
 void setMessage(java.lang.String s)
          Sets the value of message.
 void setOperand1(java.lang.String op1)
          Sets the value of operand1.
 void setOperand2(java.lang.String op2)
          Sets the value of operand2.
 void setOperation(java.lang.String s)
          Sets the value of operation by converting the name of the operation to its mathematical symbol.
 void setResult(java.lang.String s)
          Sets the value of result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

public java.lang.String result
The value of the mathematical operation performed


operation

public java.lang.String operation
The mathematical operation to be performed


operand1

public java.lang.String operand1
A number to perform this mathematical operation on


operand2

public java.lang.String operand2
Another number to perform this mathematical operation on


message

public java.lang.String message
The message informing users of the error condition encountered

Constructor Detail

BasicCalculatorJspBean

public BasicCalculatorJspBean()
Method Detail

setResult

public void setResult(java.lang.String s)
Sets the value of result.

Parameters:
s - the value of result in String

getResult

public java.lang.String getResult()
Returns the value of result (from the mathematical operation performed)

Returns:
result the value of the mathematical operation

setOperation

public void setOperation(java.lang.String s)
Sets the value of operation by converting the name of the operation to its mathematical symbol.

Parameters:
s - the name of the operation

getOperation

public java.lang.String getOperation()
Returns the value of the operation as a symbol +, -, *, /

Returns:
operation the symbol representing the operation add, subtract, multiply, or divide

setOperand1

public void setOperand1(java.lang.String op1)
Sets the value of operand1.

Parameters:
op1 - the value of operand1 in String

getOperand1

public java.lang.String getOperand1()
Returns the value of the first operand

Returns:
operand1 the value of the first operand

setOperand2

public void setOperand2(java.lang.String op2)
Sets the value of operand2.

Parameters:
op2 - the value of operand2 in String

getOperand2

public java.lang.String getOperand2()
Returns the value of the second operand

Returns:
operand1 the value of the second operand

setMessage

public void setMessage(java.lang.String s)
Sets the value of message. This is used to display error conditions to the user on the JSP

Parameters:
s - the message for the error condition encountered

getMessage

public java.lang.String getMessage()
Returns the value of message

Returns:
message the value of the message to be displayed