Chat applikasjon
Public Member Functions | List of all members
resources.CalculatorResource Class Reference

Public Member Functions

int calculate (String expression)
 
int sum (String expression)
 
int subtraction (String expression)
 
int multiplication (String expression)
 

Detailed Description

Calculator resource exposed at '/calculator' path

Member Function Documentation

◆ calculate()

int resources.CalculatorResource.calculate ( String  expression)
inline

Method handling HTTP POST requests. The calculated answer to the expression will be sent to the client as plain/text.

Parameters
expressionthe expression to be solved as plain/text.
Returns
solution to the expression as plain/text or -1 on error

◆ multiplication()

int resources.CalculatorResource.multiplication ( String  expression)
inline

Method used to calculate a multiplication expression.

Parameters
expressionthe expression to be calculated as a String
Returns
the answer as an int

◆ subtraction()

int resources.CalculatorResource.subtraction ( String  expression)
inline

Method used to calculate a subtraction expression.

Parameters
expressionthe expression to be calculated as a String
Returns
the answer as an int

◆ sum()

int resources.CalculatorResource.sum ( String  expression)
inline

Method used to calculate a sum expression.

Parameters
expressionthe equation to be calculated as a String
Returns
the answer as an int

The documentation for this class was generated from the following file: