ch.elca.el4j.tests.remoting.service.impl
Class CalculatorImpl

java.lang.Object
  extended by ch.elca.el4j.tests.remoting.service.impl.CalculatorImpl
All Implemented Interfaces:
Calculator

public class CalculatorImpl
extends Object
implements Calculator

This class is the implementation of the calculator.

Author:
Martin Zeltner (MZE)
File-location:
CalculatorImpl
Last check-in date:
2009-08-04 13:59:45 +0200 (Di, 04. Aug 2009) by swismer for revision 3873

Constructor Summary
CalculatorImpl()
           
 
Method Summary
 double calculate(double a, double b, CalculatorOperation operation)
          Executes the given operation with a and b and returns the result.
 int countNumberOfUppercaseLetters(String text)
          This method counts all uppercase letters of a text.
 CalculatorValueObject echoValueObject(CalculatorValueObject valueObject)
          This method does an echo of the given object.
 double getArea(double a, double b)
          This method calculates the area of a rectangle.
 void throwMeAnException()
          This method throws an exception for test reason.
 void throwMeASpecialException(String action)
          This method throws a special exception for test reason.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalculatorImpl

public CalculatorImpl()
Method Detail

getArea

public double getArea(double a,
                      double b)
This method calculates the area of a rectangle.

Specified by:
getArea in interface Calculator
Parameters:
a - Is the first side.
b - Is the second side.
Returns:
Returns the area of the triangle.

throwMeAnException

public void throwMeAnException()
                        throws CalculatorException
This method throws an exception for test reason.

Specified by:
throwMeAnException in interface Calculator
Throws:
CalculatorException - will be thrown every time.

throwMeASpecialException

public void throwMeASpecialException(String action)
                              throws SpecialCalculatorException
This method throws a special exception for test reason.

Specified by:
throwMeASpecialException in interface Calculator
Parameters:
action - Is the dynamic part of the thrown exception.
Throws:
SpecialCalculatorException - will be thrown every time.

countNumberOfUppercaseLetters

public int countNumberOfUppercaseLetters(String text)
This method counts all uppercase letters of a text.

Specified by:
countNumberOfUppercaseLetters in interface Calculator
Parameters:
text - Is the object to analyze.
Returns:
Returns the number of uppercase letters.

echoValueObject

public CalculatorValueObject echoValueObject(CalculatorValueObject valueObject)
This method does an echo of the given object.

Specified by:
echoValueObject in interface Calculator
Parameters:
valueObject - Is the object to echo.
Returns:
Returns the received object.

calculate

public double calculate(double a,
                        double b,
                        CalculatorOperation operation)
Executes the given operation with a and b and returns the result.

Specified by:
calculate in interface Calculator
Parameters:
a - Is the first parameter for the calculation.
b - Is the second parameter for the calculation.
operation - Is the operation to execute.
Returns:
Returns the calculated result.


Copyright © 2005-2011 ELCA. All Rights Reserved.