Class EnumType

java.lang.Object
net.codecrete.windowsapi.metadata.Type
net.codecrete.windowsapi.metadata.EnumType

public final class EnumType extends Type
Enumeration type.

An enumeration is a collection of related integer constants.

  • Constructor Details

    • EnumType

      public EnumType(String name, Namespace namespace, int typeDefIndex, boolean isEnumFlags)
      Creates a new instance.
      Parameters:
      name - enumeration name
      namespace - enumeration's namespace
      typeDefIndex - the TypeDef index
      isEnumFlags - indicates if multiple enumeration values can be combined as a bitmask, representing multiple flags.
  • Method Details

    • baseType

      public Primitive baseType()
      Gets the type of the enumeration constants.

      The base type is a primitive integer type.

      Returns:
      the base type
    • setBaseType

      public void setBaseType(Primitive baseType)
      Sets the type of the enumeration constants.

      The base type must be a primitive integer type.

      Parameters:
      baseType - the base type
    • members

      public List<Member> members()
      Gets the enumeration constants.
      Returns:
      the constants
    • setMembers

      public void setMembers(List<Member> members)
      Sets the enumeration constants.
      Parameters:
      members - the constants
    • getMember

      public Member getMember(String memberName)
      Gets the member with the given name.
      Parameters:
      memberName - the member name
      Returns:
      the member, or null if no matching member was found
    • isEnumFlags

      public boolean isEnumFlags()
      Indicates if the enumeration constants can be combined as a bitmask, representing multiple flags.
      Returns:
      true if constants can be combined, false otherwise
    • referencedTypes

      public Stream<Type> referencedTypes()
      Description copied from class: Type
      Returns the types directly references by this type.
      Overrides:
      referencedTypes in class Type
      Returns:
      Stream of types