org.dellroad.stuff.java
Class PrimitiveSwitchAdapter<R>

java.lang.Object
  extended by org.dellroad.stuff.java.PrimitiveSwitchAdapter<R>
Type Parameters:
R - switch method return type
All Implemented Interfaces:
PrimitiveSwitch<R>

public class PrimitiveSwitchAdapter<R>
extends Object
implements PrimitiveSwitch<R>

Adapter class for PrimitiveSwitch implementations.

Since:
1.0.65

Constructor Summary
PrimitiveSwitchAdapter()
           
 
Method Summary
 R caseBoolean()
          Handle the Primitive.BOOLEAN case.
 R caseByte()
          Handle the Primitive.BYTE case.
 R caseCharacter()
          Handle the Primitive.CHARACTER case.
protected  R caseDefault()
          Internal roll-up method.
 R caseDouble()
          Handle the Primitive.DOUBLE case.
 R caseFloat()
          Handle the Primitive.FLOAT case.
 R caseInteger()
          Handle the Primitive.INTEGER case.
 R caseLong()
          Handle the Primitive.LONG case.
protected  R caseNumber()
          Internal roll-up method.
 R caseShort()
          Handle the Primitive.SHORT case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveSwitchAdapter

public PrimitiveSwitchAdapter()
Method Detail

caseBoolean

public R caseBoolean()
Handle the Primitive.BOOLEAN case. The implementation in PrimitiveSwitchAdapter delegates to caseDefault().

Specified by:
caseBoolean in interface PrimitiveSwitch<R>

caseByte

public R caseByte()
Handle the Primitive.BYTE case. The implementation in PrimitiveSwitchAdapter delegates to caseNumber().

Specified by:
caseByte in interface PrimitiveSwitch<R>

caseCharacter

public R caseCharacter()
Handle the Primitive.CHARACTER case. The implementation in PrimitiveSwitchAdapter delegates to caseDefault().

Specified by:
caseCharacter in interface PrimitiveSwitch<R>

caseShort

public R caseShort()
Handle the Primitive.SHORT case. The implementation in PrimitiveSwitchAdapter delegates to caseNumber().

Specified by:
caseShort in interface PrimitiveSwitch<R>

caseInteger

public R caseInteger()
Handle the Primitive.INTEGER case. The implementation in PrimitiveSwitchAdapter delegates to caseNumber().

Specified by:
caseInteger in interface PrimitiveSwitch<R>

caseFloat

public R caseFloat()
Handle the Primitive.FLOAT case. The implementation in PrimitiveSwitchAdapter delegates to caseNumber().

Specified by:
caseFloat in interface PrimitiveSwitch<R>

caseLong

public R caseLong()
Handle the Primitive.LONG case. The implementation in PrimitiveSwitchAdapter delegates to caseNumber().

Specified by:
caseLong in interface PrimitiveSwitch<R>

caseDouble

public R caseDouble()
Handle the Primitive.DOUBLE case. The implementation in PrimitiveSwitchAdapter delegates to caseNumber().

Specified by:
caseDouble in interface PrimitiveSwitch<R>

caseNumber

protected R caseNumber()
Internal roll-up method. The implementation in PrimitiveSwitchAdapter delegates to caseDefault().


caseDefault

protected R caseDefault()
Internal roll-up method. The implementation in PrimitiveSwitchAdapter returns null.