Moved all exp4j classes in same package.
This commit is contained in:
parent
97ad66256a
commit
f607d155d5
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents an argument separator in functions i.e: ','
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* represents closed parentheses
|
@ -26,15 +26,6 @@ import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.FunctionToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.NumberToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.OperatorToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Token;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.VariableToken;
|
||||
|
||||
public class Expression
|
||||
{
|
||||
private final Token[] tokens;
|
||||
|
@ -23,11 +23,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.shuntingyard.ShuntingYard;
|
||||
|
||||
/**
|
||||
* Factory class for {@link Expression} instances. This class is the main API entrypoint. Users should create new {@link Expression} instances using this factory class.
|
||||
*/
|
||||
@ -60,8 +55,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementation available for use in the expression
|
||||
* @param function the custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementation that should be available for use in the expression.
|
||||
* Add a {@link com.l2jmobius.gameserver.util.exp4j.Function} implementation available for use in the expression
|
||||
* @param function the custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementation that should be available for use in the expression.
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder function(Function function)
|
||||
@ -71,8 +66,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations available for use in the expression
|
||||
* @param functions the custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations available for use in the expression
|
||||
* @param functions the custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder functions(Function... functions)
|
||||
@ -85,8 +80,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations available for use in the expression
|
||||
* @param functions A {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations available for use in the expression
|
||||
* @param functions A {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder functions(List<Function> functions)
|
||||
@ -138,8 +133,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} which should be available for use in the expression
|
||||
* @param operator the custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} to add
|
||||
* Add an {@link com.l2jmobius.gameserver.util.exp4j.Operator} which should be available for use in the expression
|
||||
* @param operator the custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(Operator operator)
|
||||
@ -162,8 +157,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the set of custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations to add
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the set of custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(Operator... operators)
|
||||
@ -176,8 +171,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations to add
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(List<Operator> operators)
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.l2jmobius.gameserver.util.exp4j.function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* A class representing a Function which can be used in an expression
|
@ -13,9 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
public class FunctionToken extends Token
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Class representing the builtin functions available for use in expressions
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents a number in the expression
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
class OpenParenthesesToken extends Token
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Class representing operators that can be used in an expression
|
@ -13,9 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents an operator used in expressions
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
public abstract class Operators
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.shuntingyard;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -21,12 +21,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.OperatorToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Token;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Tokenizer;
|
||||
|
||||
/**
|
||||
* Shunting yard implementation to convert infix to reverse polish notation
|
||||
*/
|
||||
@ -39,7 +33,7 @@ public class ShuntingYard
|
||||
* @param userOperators the custom operators used
|
||||
* @param variableNames the variable names used in the expression
|
||||
* @param implicitMultiplication set to fasle to turn off implicit multiplication
|
||||
* @return a {@link com.l2jmobius.gameserver.util.exp4j.tokenizer.Token} array containing the result
|
||||
* @return a {@link com.l2jmobius.gameserver.util.exp4j.Token} array containing the result
|
||||
*/
|
||||
public static Token[] convertToRPN(final String expression, final Map<String, Function> userFunctions, final Map<String, Operator> userOperators, final Set<String> variableNames, final boolean implicitMultiplication)
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Abstract class for tokens used by exp4j to tokenize expressions
|
@ -13,16 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operators;
|
||||
|
||||
public class Tokenizer
|
||||
{
|
||||
private final char[] expression;
|
@ -1,4 +1,4 @@
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* This exception is being thrown whenever {@link Tokenizer} finds unknown function or variable.
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* represents a setVariable used in an expression
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents an argument separator in functions i.e: ','
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* represents closed parentheses
|
@ -26,15 +26,6 @@ import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.FunctionToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.NumberToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.OperatorToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Token;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.VariableToken;
|
||||
|
||||
public class Expression
|
||||
{
|
||||
private final Token[] tokens;
|
||||
|
@ -23,11 +23,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.shuntingyard.ShuntingYard;
|
||||
|
||||
/**
|
||||
* Factory class for {@link Expression} instances. This class is the main API entrypoint. Users should create new {@link Expression} instances using this factory class.
|
||||
*/
|
||||
@ -60,8 +55,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementation available for use in the expression
|
||||
* @param function the custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementation that should be available for use in the expression.
|
||||
* Add a {@link com.l2jmobius.gameserver.util.exp4j.Function} implementation available for use in the expression
|
||||
* @param function the custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementation that should be available for use in the expression.
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder function(Function function)
|
||||
@ -71,8 +66,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations available for use in the expression
|
||||
* @param functions the custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations available for use in the expression
|
||||
* @param functions the custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder functions(Function... functions)
|
||||
@ -85,8 +80,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations available for use in the expression
|
||||
* @param functions A {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations available for use in the expression
|
||||
* @param functions A {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder functions(List<Function> functions)
|
||||
@ -138,8 +133,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} which should be available for use in the expression
|
||||
* @param operator the custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} to add
|
||||
* Add an {@link com.l2jmobius.gameserver.util.exp4j.Operator} which should be available for use in the expression
|
||||
* @param operator the custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(Operator operator)
|
||||
@ -162,8 +157,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the set of custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations to add
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the set of custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(Operator... operators)
|
||||
@ -176,8 +171,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations to add
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(List<Operator> operators)
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.l2jmobius.gameserver.util.exp4j.function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* A class representing a Function which can be used in an expression
|
@ -13,9 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
public class FunctionToken extends Token
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Class representing the builtin functions available for use in expressions
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents a number in the expression
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
class OpenParenthesesToken extends Token
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Class representing operators that can be used in an expression
|
@ -13,9 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents an operator used in expressions
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
public abstract class Operators
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.shuntingyard;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -21,12 +21,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.OperatorToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Token;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Tokenizer;
|
||||
|
||||
/**
|
||||
* Shunting yard implementation to convert infix to reverse polish notation
|
||||
*/
|
||||
@ -39,7 +33,7 @@ public class ShuntingYard
|
||||
* @param userOperators the custom operators used
|
||||
* @param variableNames the variable names used in the expression
|
||||
* @param implicitMultiplication set to fasle to turn off implicit multiplication
|
||||
* @return a {@link com.l2jmobius.gameserver.util.exp4j.tokenizer.Token} array containing the result
|
||||
* @return a {@link com.l2jmobius.gameserver.util.exp4j.Token} array containing the result
|
||||
*/
|
||||
public static Token[] convertToRPN(final String expression, final Map<String, Function> userFunctions, final Map<String, Operator> userOperators, final Set<String> variableNames, final boolean implicitMultiplication)
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Abstract class for tokens used by exp4j to tokenize expressions
|
@ -13,16 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operators;
|
||||
|
||||
public class Tokenizer
|
||||
{
|
||||
private final char[] expression;
|
@ -1,4 +1,4 @@
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* This exception is being thrown whenever {@link Tokenizer} finds unknown function or variable.
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* represents a setVariable used in an expression
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents an argument separator in functions i.e: ','
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* represents closed parentheses
|
@ -26,15 +26,6 @@ import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.FunctionToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.NumberToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.OperatorToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Token;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.VariableToken;
|
||||
|
||||
public class Expression
|
||||
{
|
||||
private final Token[] tokens;
|
||||
|
@ -23,11 +23,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.shuntingyard.ShuntingYard;
|
||||
|
||||
/**
|
||||
* Factory class for {@link Expression} instances. This class is the main API entrypoint. Users should create new {@link Expression} instances using this factory class.
|
||||
*/
|
||||
@ -60,8 +55,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementation available for use in the expression
|
||||
* @param function the custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementation that should be available for use in the expression.
|
||||
* Add a {@link com.l2jmobius.gameserver.util.exp4j.Function} implementation available for use in the expression
|
||||
* @param function the custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementation that should be available for use in the expression.
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder function(Function function)
|
||||
@ -71,8 +66,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations available for use in the expression
|
||||
* @param functions the custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations available for use in the expression
|
||||
* @param functions the custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder functions(Function... functions)
|
||||
@ -85,8 +80,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations available for use in the expression
|
||||
* @param functions A {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.function.Function} implementations
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations available for use in the expression
|
||||
* @param functions A {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.Function} implementations
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder functions(List<Function> functions)
|
||||
@ -138,8 +133,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} which should be available for use in the expression
|
||||
* @param operator the custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} to add
|
||||
* Add an {@link com.l2jmobius.gameserver.util.exp4j.Operator} which should be available for use in the expression
|
||||
* @param operator the custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(Operator operator)
|
||||
@ -162,8 +157,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the set of custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations to add
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the set of custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(Operator... operators)
|
||||
@ -176,8 +171,8 @@ public class ExpressionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.operator.Operator} implementations to add
|
||||
* Add multiple {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations which should be available for use in the expression
|
||||
* @param operators the {@link java.util.List} of custom {@link com.l2jmobius.gameserver.util.exp4j.Operator} implementations to add
|
||||
* @return the ExpressionBuilder instance
|
||||
*/
|
||||
public ExpressionBuilder operator(List<Operator> operators)
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.l2jmobius.gameserver.util.exp4j.function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* A class representing a Function which can be used in an expression
|
@ -13,9 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
public class FunctionToken extends Token
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.function;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Class representing the builtin functions available for use in expressions
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents a number in the expression
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
class OpenParenthesesToken extends Token
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Class representing operators that can be used in an expression
|
@ -13,9 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Represents an operator used in expressions
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.operator;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
public abstract class Operators
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.shuntingyard;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -21,12 +21,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.OperatorToken;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Token;
|
||||
import com.l2jmobius.gameserver.util.exp4j.tokenizer.Tokenizer;
|
||||
|
||||
/**
|
||||
* Shunting yard implementation to convert infix to reverse polish notation
|
||||
*/
|
||||
@ -39,7 +33,7 @@ public class ShuntingYard
|
||||
* @param userOperators the custom operators used
|
||||
* @param variableNames the variable names used in the expression
|
||||
* @param implicitMultiplication set to fasle to turn off implicit multiplication
|
||||
* @return a {@link com.l2jmobius.gameserver.util.exp4j.tokenizer.Token} array containing the result
|
||||
* @return a {@link com.l2jmobius.gameserver.util.exp4j.Token} array containing the result
|
||||
*/
|
||||
public static Token[] convertToRPN(final String expression, final Map<String, Function> userFunctions, final Map<String, Operator> userOperators, final Set<String> variableNames, final boolean implicitMultiplication)
|
||||
{
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* Abstract class for tokens used by exp4j to tokenize expressions
|
@ -13,16 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Function;
|
||||
import com.l2jmobius.gameserver.util.exp4j.function.Functions;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operator;
|
||||
import com.l2jmobius.gameserver.util.exp4j.operator.Operators;
|
||||
|
||||
public class Tokenizer
|
||||
{
|
||||
private final char[] expression;
|
@ -1,4 +1,4 @@
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* This exception is being thrown whenever {@link Tokenizer} finds unknown function or variable.
|
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.util.exp4j.tokenizer;
|
||||
package com.l2jmobius.gameserver.util.exp4j;
|
||||
|
||||
/**
|
||||
* represents a setVariable used in an expression
|
Loading…
Reference in New Issue
Block a user