com.flazr.util
Class ValueToEnum<T extends Enum<T> & ValueToEnum.IntValue>

java.lang.Object
  extended by com.flazr.util.ValueToEnum<T>

public class ValueToEnum<T extends Enum<T> & ValueToEnum.IntValue>
extends Object

a little bit of code reuse, would have been cleaner if enum types could extend some other class - we implement an interface instead and have to construct a static instance in each enum type we use


Nested Class Summary
static interface ValueToEnum.IntValue
           
 
Constructor Summary
ValueToEnum(T[] enumValues)
           
 
Method Summary
 int getMaxIndex()
           
 T valueToEnum(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueToEnum

public ValueToEnum(T[] enumValues)
Method Detail

valueToEnum

public T valueToEnum(int i)

getMaxIndex

public int getMaxIndex()


Copyright © 2011. All Rights Reserved.