public class OperandArray extends java.lang.Object implements java.lang.Iterable<Operand>
Constructor and Description |
---|
OperandArray(Expression parent,
Expression[] args) |
OperandArray(Expression parent,
Expression[] args,
OperandRole role) |
OperandArray(Expression parent,
Expression[] args,
OperandRole[] roles) |
Modifier and Type | Method and Description |
---|---|
Operand[] |
copy() |
static <T> boolean |
every(T[] args,
java.util.function.Predicate<T> condition)
Utility method (doesn't really belong here) to test if every element of an array satisfies
some condition
|
int |
getNumberOfOperands()
Get the number of operands in the operand array
|
Operand |
getOperand(int n)
Get the operand whose identifying number is n.
|
Expression |
getOperandExpression(int n)
Get the child expression associated with the operand whose identifying number is n.
|
OperandRole[] |
getRoles()
Get the operand roles
|
java.util.Iterator<Operand> |
iterator()
Returns an iterator over elements of type
T . |
java.lang.Iterable<Expression> |
operandExpressions() |
java.lang.Iterable<Operand> |
operands()
Return a collection containing all the operands.
|
void |
setOperand(int n,
Expression child)
Set the value of the operand with integer n.
|
static <T> boolean |
some(T[] args,
java.util.function.Predicate<T> condition)
Utility method (doesn't really belong here) to test if some element of an array satisfies
some condition
|
public OperandArray(Expression parent, Expression[] args)
public OperandArray(Expression parent, Expression[] args, OperandRole[] roles)
public OperandArray(Expression parent, Expression[] args, OperandRole role)
public java.util.Iterator<Operand> iterator()
T
.iterator
in interface java.lang.Iterable<Operand>
public Operand[] copy()
public OperandRole[] getRoles()
public Operand getOperand(int n)
n
- the identifier of the operand (counting from zero)java.lang.IllegalArgumentException
- if there cannot be an operand at this positionpublic Expression getOperandExpression(int n)
n
- the identifier of the operandjava.lang.IllegalArgumentException
- if there cannot be an operand at this positionpublic java.lang.Iterable<Operand> operands()
public java.lang.Iterable<Expression> operandExpressions()
public void setOperand(int n, Expression child)
n
- identifies the expression to be set/replacedchild
- the new subexpressionjava.lang.IllegalArgumentException
- if the value of n identifies no operandpublic int getNumberOfOperands()
public static <T> boolean every(T[] args, java.util.function.Predicate<T> condition)
T
- the type of the items in the arrayargs
- the arraycondition
- the conditionpublic static <T> boolean some(T[] args, java.util.function.Predicate<T> condition)
T
- the type of the items in the arrayargs
- the arraycondition
- the conditionCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.