Package parser

Class ListReturningStatsOperator

    • Constructor Detail

      • ListReturningStatsOperator

        public ListReturningStatsOperator​(java.lang.String op,
                                          int index,
                                          java.util.ArrayList<java.lang.String> scan)
        Parameters:
        op - the name of the operator
        index - the index of this Operator in its parent scanned function.
        scan - the ArrayList object that contains the scanned function that has this ListReturningStatsOperator object
    • Method Detail

      • setOpenBracket

        public void setOpenBracket​(Bracket openBracket)
        Parameters:
        openBracket - sets the opening bracket for this Operator
      • getOpenBracket

        public Bracket getOpenBracket()
        Returns:
        the opening bracket for this Operator
      • setCloseBracket

        public void setCloseBracket​(Bracket closeBracket)
        Parameters:
        closeBracket - sets the closing bracket for this Operator
      • getCloseBracket

        public Bracket getCloseBracket()
        Returns:
        the closing bracket for this Operator
      • setIndex

        public void setIndex​(int index)
        Parameters:
        index - sets the location of this Operator object in its parent scanned function.
      • getIndex

        public int getIndex()
        Returns:
        the index of its parent scanned function.
      • setSuperParent

        public void setSuperParent​(boolean superParent)
        Parameters:
        superParent - sets whether or not this is the container ListReturningStatsOperator object for the data set.
      • isSuperParent

        public boolean isSuperParent()
        Returns:
        true if this is the container ListReturningStatsOperator object for the data set.
      • setParent

        public void setParent​(ListReturningStatsOperator parent)
        The concept of a parent here is that the first ListReturningStatsOperator object to this Operator's left is one that encloses it. i.e sort(2,3,mode(4,1,1,3)) Here sort is a parent to mode. But in sort(2,3,sort(4,1,3,4),mode(4,5,1)),mode will have no parent here by our definition. The outermost sort which would have been its parent does not immediately enclose it.The outermost sort however is a parent to the second sort(4,1,3,4). We use this special definition for parent because we wish to ensure that each object of this class will validate its own surroundings, not even its contents. It will not validate beyond the next ListReturningStatsOperator to it.
        Parameters:
        parent - sets the ListReturningStatsOperator object that immediately envelopes this one.
      • getParent

        public ListReturningStatsOperator getParent()
        Returns:
        the ListReturningStatsOperator object that immediately envelopes this one.
      • setErrorMessage

        public static void setErrorMessage​(java.lang.String errorMessage)
        Parameters:
        errorMessage - sets the error message generated by objects of this class.
      • getErrorMessage

        public static java.lang.String getErrorMessage()
        Returns:
        the error message generated by objects of this class.
      • hasParent

        public boolean hasParent​(java.util.ArrayList<java.lang.String> scan)
        Parameters:
        scan - the ArrayList containing the scanned function
        Returns:
        true if the first ListReturningStatsOperator object to its left is its parent. So it can have a parent and yet return false here.
      • validate

        public boolean validate​(java.util.ArrayList<java.lang.String> scan)
        Specified by:
        validate in interface Validatable
        Parameters:
        scan - the ArrayList of the scanned function that contains this object
        Returns:
        true if this object scans through its surroundings to the left and to the right and sees a valid bracket structure around itself
      • validateFunction

        public static boolean validateFunction​(java.util.ArrayList<java.lang.String> scan)
        Takes an object of class Function and validates its ListReturningStatsOperators objects.
        Parameters:
        scan - the scanner output
        Returns:
        true if valid
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object