public class UnaryExpression extends Object implements Expression, ElementAssignable
Expression
with 1
operand.Modifier and Type | Field and Description |
---|---|
protected Expression |
myExpression
The sub expression.
|
protected String |
myOperator
The operator.
|
Constructor and Description |
---|
UnaryExpression(String operator,
Expression expression)
Creates a new NaryExpression.
|
protected final Expression myExpression
protected final String myOperator
public UnaryExpression(String operator, Expression expression)
operator
- The operator this object represents.expression
- The sub expression.public Element asElement()
Element
.
Overridden to return the sub expressions as an element:
"$op" : expression
asElement
in interface ElementAssignable
Element
.public DocumentElement toElement(String name)
Overridden to return the sub expressions as a document with a nested array element:
{ <name> : { "$op" : expression } }
toElement
in interface Expression
name
- The name for the expression's element.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.