Class EnumeratedType

  • All Implemented Interfaces:
    java.io.Serializable, IClusterable
    Direct Known Subclasses:
    TimeOfDay.Meridian

    public abstract class EnumeratedType
    extends StringValue
    A base class for defining enumerated types. Since this class extends StringValue, every enumerated type subclass is a StringValue that can be manipulated, converted and displayed in useful ways. In addition to constructing a type with the given name, lists are kept of all enumeration values by subclass. The list of available values in the enumeration represented by a given subclass can be retrieved by calling getValues(Class).
    Author:
    Jonathan Locke
    See Also:
    Serialized Form
    • Constructor Detail

      • EnumeratedType

        public EnumeratedType​(java.lang.String name)
        Constructor.
        Parameters:
        name - Name of this enumerated type value
    • Method Detail

      • getValues

        public static java.util.List<EnumeratedType> getValues​(java.lang.Class<? extends EnumeratedType> c)
        Gets the enumerated type values for a given subclass of EnumeratedType.
        Parameters:
        c - The enumerated type subclass to get values for
        Returns:
        List of all values of the given subclass
      • readResolve

        public java.lang.Object readResolve()
                                     throws java.io.ObjectStreamException
        Method to ensure that == works after deserialization
        Returns:
        object instance
        Throws:
        java.io.ObjectStreamException