Package org.apache.calcite.util
Class ReflectVisitorTest
- java.lang.Object
-
- org.apache.calcite.util.ReflectVisitorTest
-
public class ReflectVisitorTest extends java.lang.Object
ReflectVisitorTest testsReflectUtil.invokeVisitor(org.apache.calcite.util.ReflectiveVisitor, java.lang.Object, java.lang.Class, java.lang.String)
andReflectiveVisitor
and provides a contrived example of how to use them.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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 ofReflectVisitorTest.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 Summary
Constructors Constructor Description ReflectVisitorTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
testCarelessNegater
public void testCarelessNegater()
Tests CarelessNumberNegater.
-
testCarefulNegater
public void testCarefulNegater()
Tests CarefulNumberNegater.
-
testCluelessNegater
public void testCluelessNegater()
Tests CluelessNumberNegater.
-
testAmbiguity
public void testAmbiguity()
Tests for ambiguity detection in method lookup.
-
testNonAmbiguity
public void testNonAmbiguity()
Tests that ambiguity detection in method lookup does not kick in when a better match is available.
-
-