mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-14 19:05:19 +00:00
Format code.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user