Class Builder


  • public class Builder
    extends java.lang.Object
    A Builder to help building an Node tree from an infix stack.
    • Constructor Detail

      • Builder

        private Builder()
      • Builder

        private Builder​(Builder parent)
    • Method Detail

      • build

        public static Node build​(java.lang.Iterable<java.lang.Object> stack)
        Build a Node tree from an infix stack
        Parameters:
        stack - the stack
        Returns:
        Node root node of the tree
      • eval

        private static Node eval​(java.util.Deque<java.lang.Object> postfix)
      • infixToPostfix

        protected static java.util.Deque<java.lang.Object> infixToPostfix​(java.lang.Iterable<java.lang.Object> infixStack)
      • reverse

        protected static java.util.Deque<java.lang.Object> reverse​(java.lang.Iterable<java.lang.Object> stack)
      • start

        public static Builder.UnbalancedBuilder start()
        Creates a new instance of the builder.
        Returns:
        new builder instance