Class ExpressionParser.PriorityUnaryOperator<T>

  • Type Parameters:
    T - type of operand and result
    All Implemented Interfaces:
    java.lang.Comparable<ExpressionParser.PriorityUnaryOperator<T>>, java.util.function.Function<T,​T>, java.util.function.UnaryOperator<T>
    Enclosing class:
    ExpressionParser<T>

    private abstract static class ExpressionParser.PriorityUnaryOperator<T>
    extends java.lang.Object
    implements java.util.function.UnaryOperator<T>, java.lang.Comparable<ExpressionParser.PriorityUnaryOperator<T>>
    A unary 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 Type Field Description
      private int priority
      The operator's priority.
    • Constructor Summary

      Constructors 
      Constructor Description
      PriorityUnaryOperator​(int priority)
      Creates the PriorityUnaryOperator.
    • 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

      • PriorityUnaryOperator

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

      • compareTo

        public int compareTo​(ExpressionParser.PriorityUnaryOperator<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