+
+ +

Class ExpressionParser.PriorityBinaryOperator<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.unitConverter.math.ExpressionParser.PriorityBinaryOperator<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - type of operand and result
    +
    +
    +
    All Implemented Interfaces:
    +
    java.lang.Comparable<ExpressionParser.PriorityBinaryOperator<T>>, java.util.function.BiFunction<T,​T,​T>, java.util.function.BinaryOperator<T>
    +
    +
    +
    Enclosing class:
    +
    ExpressionParser<T>
    +
    +
    +
    private abstract static class ExpressionParser.PriorityBinaryOperator<T>
    +extends java.lang.Object
    +implements java.util.function.BinaryOperator<T>, java.lang.Comparable<ExpressionParser.PriorityBinaryOperator<T>>
    +
    A binary operator with a priority field that determines which operators apply first.
    +
    +
    Since:
    +
    2019-03-17, v0.2.0
    +
    Author:
    +
    Adrien Hopkins
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      private intpriority +
      The operator's priority.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      PriorityBinaryOperator​(int priority) +
      Creates the PriorityBinaryOperator.
      +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        priority

        +
        private final int priority
        +
        The operator's priority. Higher-priority operators are applied before lower-priority operators
        +
        +
        Since:
        +
        2019-03-17, v0.2.0
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PriorityBinaryOperator

        +
        public PriorityBinaryOperator​(int priority)
        +
        Creates the PriorityBinaryOperator.
        +
        +
        Parameters:
        +
        priority - operator's priority
        +
        Since:
        +
        2019-03-17, v0.2.0
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        compareTo

        +
        public int compareTo​(ExpressionParser.PriorityBinaryOperator<T> o)
        +
        Compares this object to another by priority. + +

        + +

        +
        +
        Specified by:
        +
        compareTo in interface java.lang.Comparable<T>
        +
        Since:
        +
        2019-03-17, v0.2.0
        +
        +
      • +
      + + + +
        +
      • +

        getPriority

        +
        public final int getPriority()
        +
        +
        Returns:
        +
        priority
        +
        Since:
        +
        2019-03-22, v0.2.0
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+