Interface Enum

All Superinterfaces:
DataType
All Known Implementing Classes:
CliAbstractSig.CliTypeCodeDataType, CliBlobMarshalSpec.CliNativeTypeDataType, CliBlobMarshalSpec.CliSafeArrayElemTypeDataType, CliFlags.CliEnumAssemblyFlags, CliFlags.CliEnumAssemblyHashAlgorithm, CliFlags.CliEnumEventAttributes, CliFlags.CliEnumFieldAttributes, CliFlags.CliEnumFileAttributes, CliFlags.CliEnumGenericParamAttributes, CliFlags.CliEnumManifestResourceAttributes, CliFlags.CliEnumMethodAttributes, CliFlags.CliEnumMethodImplAttributes, CliFlags.CliEnumMethodSemanticsAttributes, CliFlags.CliEnumParamAttributes, CliFlags.CliEnumPInvokeAttributes, CliFlags.CliEnumPropertyAttributes, CliFlags.CliEnumTypeAttributes, EnumDataType, ImageCor20Header.ImageCor20Flags

public interface Enum extends DataType
  • Method Details

    • getValue

      long getValue(String name) throws NoSuchElementException
      Get the value for the given name.
      Parameters:
      name - name of the entry.
      Returns:
      the value.
      Throws:
      NoSuchElementException - if the name does not exist in this Enum.
    • getName

      String getName(long value)
      Get the name for the given value.
      Parameters:
      value - value of the enum entry.
      Returns:
      null if the name with the given value was not found.
    • getNames

      String[] getNames(long value)
      Returns all names that map to the given value.
      Parameters:
      value - value for the enum entries.
      Returns:
      all names; null if there is not name for the given value.
    • getComment

      String getComment(String name)
      Get the comment for the given name.
      Parameters:
      name - name of the entry.
      Returns:
      the comment or the empty string if the name does not exist in this enum or if no comment is set.
    • getValues

      long[] getValues()
      Get the values of the enum entries.
      Returns:
      values sorted in ascending order
    • getNames

      String[] getNames()
      Get the names of the enum entries. The returned names are first sorted by the enum int value, then sub-sorted by name value where there are multiple name values per int value.
      Returns:
      the names of the enum entries.
    • getCount

      int getCount()
      Get the number of entries in this Enum.
      Returns:
      the number of entries in this Enum.
    • add

      void add(String name, long value)
      Add a enum entry.
      Parameters:
      name - name of the new entry
      value - value of the new entry
    • add

      void add(String name, long value, String comment)
      Add a enum entry.
      Parameters:
      name - name of the new entry
      value - value of the new entry
      comment - comment of the new entry
    • remove

      void remove(String name)
      Remove the enum entry with the given name.
      Parameters:
      name - name of entry to remove.
    • setDescription

      void setDescription(String description)
      Set the description for this Enum.
      Specified by:
      setDescription in interface DataType
      Parameters:
      description - the description
    • getRepresentation

      String getRepresentation(BigInteger bigInt, Settings settings, int bitLength)
      Get enum representation of the big-endian value.
      Parameters:
      bigInt - BigInteger value with the appropriate sign
      settings - integer format settings (PADDING, FORMAT, etc.)
      bitLength - the bit length
      Returns:
      formatted integer string