|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectNilExpression
public final class NilExpression
Placeholder class used to represent a NIL expression, evaultates to null
.
This placeholder class is allows data structures to avoid
the use of null
. Please note that Expression.NIL is
not considered a Literal with value null
(since the literal may have its
value changed).
Field Summary |
---|
Fields inherited from interface Expression |
---|
NIL |
Method Summary | ||
---|---|---|
Object |
accept(ExpressionVisitor visitor,
Object extraData)
Accepts a visitor. |
|
boolean |
equals(Object other)
Equals is defined only against Expression.NIL . |
|
Object |
evaluate(Object object)
Returns null |
|
|
evaluate(Object object,
Class<T> context)
Returns null |
|
int |
hashCode()
Returns 0 in order to agree with hashcode of null . |
|
String |
toString()
|
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Object accept(ExpressionVisitor visitor, Object extraData)
Expression
return visitor.visit(this, extraData);
accept
in interface Expression
public Object evaluate(Object object)
null
evaluate
in interface Expression
public <T> T evaluate(Object object, Class<T> context)
null
evaluate
in interface Expression
T
- The type of the returned object.object
- The object to evaluate the expression against.context
- The type of the resulting value of the expression.
context
.public boolean equals(Object other)
Expression.NIL
.
equals
in class Object
other
-
true
for Expression.NILpublic int hashCode()
0
in order to agree with hashcode of null
.
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |