ch.elca.el4j.tests.remoting.service
Interface Calculator

All Known Implementing Classes:
CalculatorImpl

public interface Calculator

This interface is a calculator.

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

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 o)
          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.
 

Method Detail

getArea

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

Parameters:
a - Is the first side.
b - Is the second side.
Returns:
Returns the area of the triangle.

throwMeAnException

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

Throws:
CalculatorException - will be thrown every time.

throwMeASpecialException

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

Parameters:
action - Is the dynamic part of the thrown exception.
Throws:
SpecialCalculatorException - will be thrown every time.

countNumberOfUppercaseLetters

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

Parameters:
text - Is the object to analyze.
Returns:
Returns the number of uppercase letters.

echoValueObject

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

Parameters:
o - Is the object to echo.
Returns:
Returns the received object.

calculate

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

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.