1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-01-14 19:05:19 +00:00

Format code.

This commit is contained in:
2017-07-30 21:11:32 -07:00
parent 03eb669eb3
commit a278e5bb9a
39 changed files with 695 additions and 561 deletions

View File

@@ -23,6 +23,7 @@ public abstract class Function {
/**
* Checks whether the given params will work for the given function.
*
* @param params the given params
* @return true if the params can be used with this function.
*/
@@ -31,6 +32,7 @@ public abstract class Function {
/**
* Internal apply implementation, which already receives appropriately promoted
* parameters that have bee run through matchesParams
*
* @param params the promoted parameters.
* @return the return value of the function.
*/
@@ -38,11 +40,12 @@ public abstract class Function {
/**
* Function to check, promote arguments and run the function.
*
* @param params the raw input parameters.
* @return the return value of the function, or null if an error occurred.
*/
public NumberInterface apply(NumberInterface...params) {
if(!matchesParams(params)) return null;
public NumberInterface apply(NumberInterface... params) {
if (!matchesParams(params)) return null;
return applyInternal(params);
}

View File

@@ -24,11 +24,12 @@ public class Operator {
/**
* Creates a new operator with the given parameters.
*
* @param associativity the associativity of the operator.
* @param precedence the precedence of the operator.
* @param function the function that the operator calls.
* @param precedence the precedence of the operator.
* @param function the function that the operator calls.
*/
public Operator(OperatorAssociativity associativity, OperatorType operatorType, int precedence, Function function){
public Operator(OperatorAssociativity associativity, OperatorType operatorType, int precedence, Function function) {
this.associativity = associativity;
this.type = operatorType;
this.precedence = precedence;
@@ -37,6 +38,7 @@ public class Operator {
/**
* Gets the operator's associativity.
*
* @return the associativity.
*/
public OperatorAssociativity getAssociativity() {
@@ -45,6 +47,7 @@ public class Operator {
/**
* Gets the operator's type.
*
* @return the type.
*/
public OperatorType getType() {
@@ -53,6 +56,7 @@ public class Operator {
/**
* Gets the operator's precedence.
*
* @return the precedence.
*/
public int getPrecedence() {
@@ -61,6 +65,7 @@ public class Operator {
/**
* Gets the operator's function.
*
* @return the function.
*/
public Function getFunction() {