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

Public Member Functions

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

Detailed Description

Calculator resource exposed at '/calculator' path

Member Function Documentation

◆ calculate()

String 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

◆ 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: