Module utilities

Class EnumerationType

All Implemented Interfaces:
Member, Type, ListModel

public class EnumerationType extends TypeImpl implements ListModel
An EnumerationType is a type whose values are drawn from an enumeration. The enumeration type is either integral (consecutive int values beginning with 0) or a reference type (a set of Object values).
Author:
Ole Kniemeyer
  • Field Details

    • INT_ENUMERATION

      public static final EnumerationType INT_ENUMERATION
      An "abstract" base enumeration type which is used as supertype for those enumeration types which use ints to encode their values.
    • OBJECT_ENUMERATION

      public static final EnumerationType OBJECT_ENUMERATION
      An "abstract" base enumeration type which is used as supertype for those enumeration types which use Objects to encode their values.
    • values

      protected ObjectList values
      Contains the values of this enumeration type.
    • descriptions

      protected ObjectList descriptions
      Contains the descriptions for the values of this enumeration type.
  • Constructor Details

    • EnumerationType

      public EnumerationType(String name, Object[] values, EnumerationType superType, Type implType)
      Creates a new EnumerationType consisting of values.length values, their type being determined by supertype/code>.
      Parameters:
      name - a name for the type
      values - the representation of the enumeration values
      superType - the supertype
      implType - the class of the internal values
    • EnumerationType

      public EnumerationType(String name, String[] descriptions)
      Creates a new EnumerationType consisting of descriptions.length values of type int beginning with 0. A string representation of the values is obtained from the specified descriptions.
      Parameters:
      name - a name for the type
      descriptions - strings to represent the values
    • EnumerationType

      public EnumerationType(String name, I18NBundle bundle, String[] suffixes)
      Creates a new EnumerationType consisting of keys.length values of type int beginning with 0. The representation of the values is obtained from the specified resource bundle using the suffixes: The keys for the bundle are the concatenations name + '.' + suffixes[i].
      Parameters:
      name - a name for the type
      bundle - the resource bundle to obtain representations for the values
      suffixes - the suffixes to use for the resource bundle
    • EnumerationType

      public EnumerationType(String name, I18NBundle bundle, String[] suffixes, Object[] values, Type implType)
    • EnumerationType

      public EnumerationType(String name, I18NBundle bundle, int count)
      Creates a new EnumerationType consisting of count values of type int beginning with 0. The representation of the values is obtained from the specified resource bundle: The used key for value i is name.i.
      Parameters:
      name - the base name for the keys and the name of the type
      bundle - the resource bundle to obtain representations for the values
      count - the number of values of this enumeration
  • Method Details