Class ListReturningStatsOperator
java.lang.Object
com.github.gbenroscience.parser.Operator
com.github.gbenroscience.parser.ListReturningStatsOperator
- All Implemented Interfaces:
Validatable
- Author:
- GBEMIRO
-
Field Summary
Fields inherited from class com.github.gbenroscience.parser.Operator
AND, ASSIGN, AT, CLOSE_CIRC_BRAC, CLOSE_SQUARE_BRAC, COLON, COMBINATION, COMMA, CONST, CUBE, CUBE_ROOT, DIVIDE, EN_DASH, EQUALS, EXIT, FACTORIAL, GREATER_OR_EQUALS, GREATER_THAN, INVERSE, LESS_OR_EQUALS, LESS_THAN, MINUS, MULTIPLY, name, OPEN_CIRC_BRAC, OPEN_SQUARE_BRAC, operators, OR, PERMUTATION, PLUS, POWER, REMAINDER, ROOT, SEMI_COLON, SPACE, SQUARE, STORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringintgetIndex()booleanbooleanvoidsetCloseBracket(Bracket closeBracket) static voidsetErrorMessage(String errorMessage) voidsetIndex(int index) voidsetOpenBracket(Bracket openBracket) voidsetParent(ListReturningStatsOperator parent) The concept of a parent here is that the first ListReturningStatsOperator object to this Operator's left is one that encloses it.voidsetSuperParent(boolean superParent) toString()booleanstatic booleanvalidateFunction(ArrayList<String> scan) Takes an object of class Function and validates its ListReturningStatsOperators objects.Methods inherited from class com.github.gbenroscience.parser.Operator
getName, getPrecedence, isAssignmentOperator, isAtOperator, isBinaryOperator, isBracket, isClosingBrace, isClosingBracket, isColon, isComma, isConstantStoreCommand, isCube, isCubeRoot, isEqualsOperator, isExitCommand, isFactorial, isGreaterOrEqualsOperator, isGreaterThanOperator, isInverse, isLessThanOperator, isLessThanOrEqualsOperator, isLogicOperator, isMulOrDiv, isMulOrDivOrRemOrPermOrCombOrPow, isOpeningBrace, isOpeningBracket, isOperatorString, isPermOrComb, isPlusOrMinus, isPower, isRemainder, isSemiColon, isSquare, isSquareRoot, isStoreCommand, isUnaryPostOperator, isUnaryPreOperator, setName, validateAll
-
Constructor Details
-
ListReturningStatsOperator
-
-
Method Details
-
setOpenBracket
- Parameters:
openBracket- sets the opening bracket for this Operator
-
getOpenBracket
- Returns:
- the opening bracket for this Operator
-
setCloseBracket
- Parameters:
closeBracket- sets the closing bracket for this Operator
-
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
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
- Returns:
- the ListReturningStatsOperator object that immediately envelopes this one.
-
setErrorMessage
- Parameters:
errorMessage- sets the error message generated by objects of this class.
-
getErrorMessage
- Returns:
- the error message generated by objects of this class.
-
hasParent
-
validate
- Specified by:
validatein interfaceValidatable- 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
-
toString
-