Class NumericCondition
java.lang.Object
me.neznamy.tab.shared.placeholders.conditions.simple.SimpleCondition
me.neznamy.tab.shared.placeholders.conditions.simple.NumericCondition
- Direct Known Subclasses:
LessThanCondition,LessThanOrEqualsCondition,MoreThanCondition,MoreThanOrEqualsCondition
An abstract class handling numeric conditions to avoid
repeated number parsing for static numbers and therefore
reduce memory allocations and improve performance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetLeftSide(me.neznamy.tab.api.TabPlayer p) Returns left side of this condition.doublegetRightSide(me.neznamy.tab.api.TabPlayer p) Returns right side of this condition.protected voidSets raw values of sides and finds used placeholdersMethods inherited from class me.neznamy.tab.shared.placeholders.conditions.simple.SimpleCondition
compile, isMet, parseLeftSide, parseRightSide, parseSide
-
Constructor Details
-
NumericCondition
public NumericCondition()
-
-
Method Details
-
getLeftSide
public double getLeftSide(me.neznamy.tab.api.TabPlayer p) Returns left side of this condition. If it's a static number it is returned, if not, placeholders are replaced and then text parsed and returned.- Parameters:
p- player to get left side for- Returns:
- parsed left side
-
getRightSide
public double getRightSide(me.neznamy.tab.api.TabPlayer p) Returns right side of this condition. If it's a static number it is returned, if not, placeholders are replaced and then text parsed and returned.- Parameters:
p- player to get right side for- Returns:
- parsed right side
-
setSides
Description copied from class:SimpleConditionSets raw values of sides and finds used placeholders- Overrides:
setSidesin classSimpleCondition- Parameters:
leftSide- left side of conditionrightSide- right side of condition
-