public class ReflectVisitorTest extends Object
ReflectUtil.invokeVisitor(org.apache.calcite.util.ReflectiveVisitor, java.lang.Object, java.lang.Class, java.lang.String)
and
ReflectiveVisitor
and provides a contrived example of how to use
them.Modifier and Type | Class and Description |
---|---|
class |
ReflectVisitorTest.AmbiguousNumber
A class inheriting two interfaces, leading to ambiguity.
|
class |
ReflectVisitorTest.CarefulNumberNegater
CarefulNumberNegater implements NumberNegater in a careful fashion by
providing overloads for each known subclass of Number and returning the
same subclass for the result.
|
class |
ReflectVisitorTest.CarelessNumberNegater
CarelessNumberNegater implements NumberNegater in a careless fashion by
converting its input to a double and then negating that.
|
class |
ReflectVisitorTest.CluelessNumberNegater
CluelessNumberNegater implements NumberNegater in a very broken fashion;
does the right thing for Shorts, but attempts to override visit(Object).
|
static interface |
ReflectVisitorTest.CrunchableNumber
An interface for introducing ambiguity into the class hierarchy.
|
static interface |
ReflectVisitorTest.DiceyNumber
Sub-interface of
ReflectVisitorTest.FudgeableNumber . |
static interface |
ReflectVisitorTest.FudgeableNumber
An interface for introducing ambiguity into the class hierarchy.
|
class |
ReflectVisitorTest.IndecisiveNumberNegater
IndecisiveNumberNegater implements NumberNegater in such a way that it
doesn't know what to do when presented with an AmbiguousNumber.
|
class |
ReflectVisitorTest.NumberNegater
NumberNegater defines the abstract base for a computation object capable
of negating an arbitrary number.
|
class |
ReflectVisitorTest.SomewhatAmbiguousNumber
A class inheriting a root interface (FudgeableNumber) two different ways,
which should not lead to ambiguity in some cases.
|
class |
ReflectVisitorTest.SomewhatIndecisiveNumberNegater
SomewhatIndecisiveNumberNegater implements NumberNegater in such a way
that it knows what to do when presented with a SomewhatAmbiguousNumber.
|
Constructor and Description |
---|
ReflectVisitorTest() |
Modifier and Type | Method and Description |
---|---|
void |
testAmbiguity()
Tests for ambiguity detection in method lookup.
|
void |
testCarefulNegater()
Tests CarefulNumberNegater.
|
void |
testCarelessNegater()
Tests CarelessNumberNegater.
|
void |
testCluelessNegater()
Tests CluelessNumberNegater.
|
void |
testNonAmbiguity()
Tests that ambiguity detection in method lookup does not kick in when a
better match is available.
|
public void testCarelessNegater()
public void testCarefulNegater()
public void testCluelessNegater()
public void testAmbiguity()
public void testNonAmbiguity()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.