Package ghidra.program.model.data
Interface Enum
-
- All Superinterfaces:
DataType
- All Known Implementing Classes:
CliAbstractSig.CliTypeCodeDataType
,CliBlobMarshalSpec.CliNativeTypeDataType
,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
-
-
Field Summary
-
Fields inherited from interface ghidra.program.model.data.DataType
CONFLICT_SUFFIX, DEFAULT, NO_LAST_CHANGE_TIME, NO_SOURCE_SYNC_TIME, VOID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(java.lang.String name, long value)
Add a enum entry.int
getCount()
Get the number of entries in this Enum.java.lang.String
getName(long value)
Get the name for the given value.java.lang.String[]
getNames()
Get the names of the enum entries.java.lang.String
getRepresentation(java.math.BigInteger bigInt, Settings settings, int bitLength)
Get enum representation of the big-endian value.long
getValue(java.lang.String name)
Get the value for the given name.long[]
getValues()
Get the values of the enum entries.void
remove(java.lang.String name)
Remove the enum entry with the given name.void
setDescription(java.lang.String description)
Set the description for this Enum.-
Methods inherited from interface ghidra.program.model.data.DataType
addParent, clone, copy, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, getAlignment, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getDocs, getLastChangeTime, getLastChangeTimeInSourceArchive, getLength, getMnemonic, getName, getParents, getPathName, getRepresentation, getSettingsDefinitions, getSourceArchive, getUniversalID, getValue, getValueClass, isDeleted, isDynamicallySized, isEquivalent, isNotYetDefined, removeParent, replaceWith, setCategoryPath, setDefaultSettings, setLastChangeTime, setLastChangeTimeInSourceArchive, setName, setNameAndCategory, setSourceArchive
-
-
-
-
Method Detail
-
getValue
long getValue(java.lang.String name) throws java.util.NoSuchElementException
Get the value for the given name.- Parameters:
name
- name of the entry- Returns:
- the value
- Throws:
java.util.NoSuchElementException
- if the name does not exist in this Enum
-
getName
java.lang.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.
-
getValues
long[] getValues()
Get the values of the enum entries.- Returns:
- values sorted in ascending order
-
getNames
java.lang.String[] getNames()
Get the names of the enum entries.
-
getCount
int getCount()
Get the number of entries in this Enum.
-
add
void add(java.lang.String name, long value)
Add a enum entry.- Parameters:
name
- name of the new entryvalue
- value of the new entry
-
remove
void remove(java.lang.String name)
Remove the enum entry with the given name.- Parameters:
name
- name of entry to remove.
-
setDescription
void setDescription(java.lang.String description)
Set the description for this Enum.- Specified by:
setDescription
in interfaceDataType
- Parameters:
description
-
-
getRepresentation
java.lang.String getRepresentation(java.math.BigInteger bigInt, Settings settings, int bitLength)
Get enum representation of the big-endian value.- Parameters:
bigInt
- BigInteger value with the appropriate signsettings
- integer format settings (PADDING, FORMAT, etc.)- Returns:
- formatted integer string
-
-