Uses of Class
java.lang.Enum

Packages that useEnum
Package
Description
java.lang
Provides classes that are fundamental to the design of the Java programming language.
java.lang.invoke
Thejava.lang.invoke package provides low-level primitives for interacting with the Java Virtual Machine.
java.util
Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.
  • Uses ofEnum injava.lang

    Classes injava.lang with type parameters of typeEnum
    Modifier and Type
    Class
    Description
    class 
    Enum<E extendsEnum<E>>
    This is the common base class of all Java language enumeration classes.
    static final class 
    Enum.EnumDesc<E extendsEnum<E>>
    Anominal descriptor for anenum constant.
    Methods injava.lang with type parameters of typeEnum
    Modifier and Type
    Method
    Description
    static <E extendsEnum<E>>
    Enum.EnumDesc<E>
    Enum.EnumDesc.of(ClassDesc enumClass,String constantName)
    Returns a nominal descriptor for the specifiedenum class and name
    static <T extendsEnum<T>>
    T
    Enum.valueOf(Class<T> enumClass,String name)
    Returns the enum constant of the specified enum class with the specified name.
    Methods injava.lang that return types with arguments of typeEnum
    Modifier and Type
    Method
    Description
    Class<? extendsEnum>
    EnumConstantNotPresentException.enumType()
    Returns the type of the missing enum constant.
    Constructor parameters injava.lang with type arguments of typeEnum
    Modifier
    Constructor
    Description
     
    EnumConstantNotPresentException(Class<? extendsEnum> enumType,String constantName)
    Constructs anEnumConstantNotPresentException for the specified constant.
  • Uses ofEnum injava.lang.invoke

    Methods injava.lang.invoke with type parameters of typeEnum
    Modifier and Type
    Method
    Description
    static <E extendsEnum<E>>
    E
    ConstantBootstraps.enumConstant(MethodHandles.Lookup lookup,String name,Class<E> type)
    Returns anenum constant of the type specified bytype with the name specified byname.
  • Uses ofEnum injava.util

    Classes injava.util with type parameters of typeEnum
    Modifier and Type
    Class
    Description
    class 
    EnumMap<K extendsEnum<K>,V>
    A specializedMap implementation for use with enum type keys.
    class 
    EnumSet<E extendsEnum<E>>
    A specializedSet implementation for use with enum types.
    Methods injava.util with type parameters of typeEnum
    Modifier and Type
    Method
    Description
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.allOf(Class<E> elementType)
    Creates an enum set containing all of the elements in the specified element type.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.complementOf(EnumSet<E> s)
    Creates an enum set with the same element type as the specified enum set, initially containing all the elements of this type that arenot contained in the specified set.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.copyOf(Collection<E> c)
    Creates an enum set initialized from the specified collection.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.copyOf(EnumSet<E> s)
    Creates an enum set with the same element type as the specified enum set, initially containing the same elements (if any).
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.noneOf(Class<E> elementType)
    Creates an empty enum set with the specified element type.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.of(E e)
    Creates an enum set initially containing the specified element.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.of(E e1, E e2)
    Creates an enum set initially containing the specified elements.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.of(E first, E... rest)
    Creates an enum set initially containing the specified elements.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.of(E e1, E e2, E e3)
    Creates an enum set initially containing the specified elements.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.of(E e1, E e2, E e3, E e4)
    Creates an enum set initially containing the specified elements.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.of(E e1, E e2, E e3, E e4, E e5)
    Creates an enum set initially containing the specified elements.
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.range(E from, E to)
    Creates an enum set initially containing all of the elements in the range defined by the two specified endpoints.
    Methods injava.util with parameters of typeEnum
    Modifier and Type
    Method
    Description
    static <E extendsEnum<E>>
    EnumSet<E>
    EnumSet.of(E first, E... rest)
    Creates an enum set initially containing the specified elements.