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

public abstract class NumericCondition extends SimpleCondition
An abstract class handling numeric conditions to avoid repeated number parsing for static numbers and therefore reduce memory allocations and improve performance.
  • 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

      protected void setSides(String leftSide, String rightSide)
      Description copied from class: SimpleCondition
      Sets raw values of sides and finds used placeholders
      Overrides:
      setSides in class SimpleCondition
      Parameters:
      leftSide - left side of condition
      rightSide - right side of condition