Class ListExp
java.lang.Object
org.apache.cayenne.exp.Expression
org.apache.cayenne.exp.ListExp
- All Implemented Interfaces:
XMLSerializable
A leaf expression representing an immutable collection of values.
- Since:
- 5.0
-
Field Summary
FieldsFields inherited from class Expression
operands, PRUNED_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendAsString(Appendable out) Appends own content as a String to the provided Appendable: the operands separated by the operator.protected ObjectEvaluates itself with object, pushing result on the stack.protected StringgetExpressionOperator(int index) Returns the operator printed between the operands, before the operand at the given index.getOperand(int index) Returns a value of operand atindex: a nested expression or a plain value.intReturns a count of operands of this expression.inthashCode()protected booleanWhether this node is wrapped in parentheses when printed as an operand of another node.voidsetOperand(int index, Object value) Sets a value of operand atindex, growing the operands array if needed.voidsetOperands(Object... elements) Sets the elements of this list.protected voidSets an internal collection of values.Creates a copy of this expression node, without copying children.Methods inherited from class Expression
andExp, andExp, appendOperandAsString, deepCopy, encodeAsXML, equals, evaluate, evaluateOperand, exists, expName, filter, filterObjects, first, flattenTree, getPathAliases, isValidParent, match, notExists, notExp, orExp, orExp, params, params, paramsArray, pruneNodeForPrunedChild, toString, transform, transformExpression, traverse, traverse
-
Field Details
-
values
-
-
Constructor Details
-
ListExp
Creates a list of the given elements. A single Collection, array or Iterator argument is taken as the elements themselves.
-
-
Method Details
-
shallowCopy
Creates a copy of this expression node, without copying children.- Specified by:
shallowCopyin classExpression
-
evaluateNode
Description copied from class:ExpressionEvaluates itself with object, pushing result on the stack.- Specified by:
evaluateNodein classExpression- Throws:
Exception
-
getExpressionOperator
Description copied from class:ExpressionReturns the operator printed between the operands, before the operand at the given index.- Specified by:
getExpressionOperatorin classExpression
-
appendAsString
Description copied from class:ExpressionAppends own content as a String to the provided Appendable: the operands separated by the operator.- Overrides:
appendAsStringin classExpression- Throws:
IOException
-
getOperandCount
public int getOperandCount()Description copied from class:ExpressionReturns a count of operands of this expression. In real life there are unary (count == 1), binary (count == 2) and ternary (count == 3) expressions.- Overrides:
getOperandCountin classExpression
-
getOperand
Description copied from class:ExpressionReturns a value of operand atindex: a nested expression or a plain value. Operand indexing starts at 0.- Overrides:
getOperandin classExpression
-
setOperand
Description copied from class:ExpressionSets a value of operand atindex, growing the operands array if needed. Operand indexing starts at 0. APersistentis replaced with its ObjectId. A nested expression is asked first whether this node is a valid parent for it, seeExpression.isValidParent(Expression).- Overrides:
setOperandin classExpression
-
setValues
Sets an internal collection of values. Value argument can be an Object[], a Collection or an iterator. -
setOperands
Sets the elements of this list. This is how the parser passes the parsed elements.- Overrides:
setOperandsin classExpression
-
hashCode
public int hashCode()- Overrides:
hashCodein classExpression
-
parenthesizeAsOperand
protected boolean parenthesizeAsOperand()Description copied from class:ExpressionWhether this node is wrapped in parentheses when printed as an operand of another node. Compound nodes are, leaves and nodes with their own delimiters (function calls, lists) are not.- Overrides:
parenthesizeAsOperandin classExpression
-