Package org.apache.calcite.util
Class ReflectVisitorTest.NumberNegater
- java.lang.Object
-
- org.apache.calcite.util.ReflectVisitorTest.NumberNegater
-
- All Implemented Interfaces:
org.apache.calcite.util.ReflectiveVisitor
- Direct Known Subclasses:
ReflectVisitorTest.CarelessNumberNegater
,ReflectVisitorTest.CluelessNumberNegater
,ReflectVisitorTest.IndecisiveNumberNegater
,ReflectVisitorTest.SomewhatIndecisiveNumberNegater
- Enclosing class:
- ReflectVisitorTest
public abstract class ReflectVisitorTest.NumberNegater extends java.lang.Object implements org.apache.calcite.util.ReflectiveVisitor
NumberNegater defines the abstract base for a computation object capable of negating an arbitrary number. Subclasses implement the computation by publishing methods with the signature "void visit(X x)" where X is a subclass of Number.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.calcite.util.ReflectiveVisitDispatcher<ReflectVisitorTest.NumberNegater,java.lang.Number>
dispatcher
protected java.lang.Number
result
-
Constructor Summary
Constructors Constructor Description NumberNegater()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Number
negate(java.lang.Number n)
Negates the given number.java.lang.Number
negateWithoutDispatcher(java.lang.Number n)
Negates the given number without using a dispatcher object to cache applicable methods.
-
-
-
Field Detail
-
result
protected java.lang.Number result
-
dispatcher
private final org.apache.calcite.util.ReflectiveVisitDispatcher<ReflectVisitorTest.NumberNegater,java.lang.Number> dispatcher
-
-
Method Detail
-
negate
public java.lang.Number negate(java.lang.Number n)
Negates the given number.- Parameters:
n
- the number to be negated- Returns:
- the negated result; not guaranteed to be the same concrete type as n; null is returned if n's type wasn't handled
-
negateWithoutDispatcher
public java.lang.Number negateWithoutDispatcher(java.lang.Number n)
Negates the given number without using a dispatcher object to cache applicable methods. The results should be the same asnegate(Number)
.- Parameters:
n
- the number to be negated- Returns:
- the negated result; not guaranteed to be the same concrete type as n; null is returned if n's type wasn't handled
-
-