Top Description Inners Fields Constructors Methods
jnr.constants.platform

pack-priv Class ConstantResolver<E extends java.lang.Enum<E>>

extends Object
Class Inheritance
Imports
jnr.constants.PlatformConstants, .Constant, .ConstantSet, java.lang.reflect.Array, java.util.EnumSet, .Map, java.util.concurrent.ConcurrentHashMap, java.util.concurrent.atomic.AtomicLong

Provides forward and reverse lookup utilities to cross-platform enums

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final String
private final boolean
private Constant[]
private volatile int
private volatile ConstantSet
private final Class<E>
private final Object
private final AtomicLong
private final Map<Long, E>
private volatile E[]

Constructor Summary

AccessConstructor and Description
private
ConstantResolver(Class<E> enumType)

private
ConstantResolver(Class<E> enumType, int firstUnknown, int lastUnknown, boolean bitmask)

Method Summary

Modifier and TypeMethod and Description
pack-priv final boolean
defined(E e)

pack-priv final String
pack-priv static <T extends Enum<T>> ConstantResolver<T>
private Constant
private ConstantSet
pack-priv static <T extends Enum<T>> ConstantResolver<T>
getResolver(Class<T> enumType)

pack-priv static <T extends Enum<T>> ConstantResolver<T>
getResolver(Class<T> enumType, int first, int last)

pack-priv final int
intValue(E e)

pack-priv final long
longValue(E e)

private Constant
pack-priv final E
valueOf(long value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__UNKNOWN_CONSTANT__back to summary
public static final String __UNKNOWN_CONSTANT__
bitmaskback to summary
private final boolean bitmask
cacheback to summary
private Constant[] cache
cacheGuardback to summary
private volatile int cacheGuard
constantsback to summary
private volatile ConstantSet constants
enumTypeback to summary
private final Class<E> enumType
modLockback to summary
private final Object modLock
nextUnknownback to summary
private final AtomicLong nextUnknown
reverseLookupMapback to summary
private final Map<Long, E> reverseLookupMap
valueCacheback to summary
private volatile E[] valueCache

Constructor Detail

ConstantResolverback to summary
private ConstantResolver(Class<E> enumType)
ConstantResolverback to summary
private ConstantResolver(Class<E> enumType, int firstUnknown, int lastUnknown, boolean bitmask)

Method Detail

definedback to summary
pack-priv final boolean defined(E e)
descriptionback to summary
pack-priv final String description(E e)
getBitmaskResolverback to summary
pack-priv static <T extends Enum<T>> ConstantResolver<T> getBitmaskResolver(Class<T> enumType)
getConstantback to summary
private Constant getConstant(E e)
getConstantsback to summary
private ConstantSet getConstants()
getResolverback to summary
pack-priv static <T extends Enum<T>> ConstantResolver<T> getResolver(Class<T> enumType)
getResolverback to summary
pack-priv static <T extends Enum<T>> ConstantResolver<T> getResolver(Class<T> enumType, int first, int last)
intValueback to summary
pack-priv final int intValue(E e)
longValueback to summary
pack-priv final long longValue(E e)
lookupAndCacheConstantback to summary
private Constant lookupAndCacheConstant(E e)
valueOfback to summary
pack-priv final E valueOf(long value)
Annotations
@SuppressWarnings:unchecked
jnr.constants.platform back to summary

private final Class ConstantResolver.UnknownConstant

extends Object
implements Constant
Class Inheritance
All Implemented Interfaces
jnr.constants.Constant

Field Summary

Modifier and TypeField and Description
private final String
private final long

Constructor Summary

AccessConstructor and Description
pack-priv
UnknownConstant(long value, String name)

Method Summary

Modifier and TypeMethod and Description
private void
public final boolean
public final int
public final long
public final String
public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private final String name
valueback to summary
private final long value

Constructor Detail

UnknownConstantback to summary
pack-priv UnknownConstant(long value, String name)

Method Detail

checkFakeback to summary
private void checkFake()
definedback to summary
public final boolean defined()

Implements jnr.constants.Constant.defined.

intValueback to summary
public final int intValue()

Implements jnr.constants.Constant.intValue.

longValueback to summary
public final long longValue()

Implements jnr.constants.Constant.longValue.

nameback to summary
public final String name()

Implements jnr.constants.Constant.name.

toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
valueback to summary
public int value()