Package mars.mips.hardware
Enum Class Endianness
- All Implemented Interfaces:
Serializable
,Comparable<Endianness>
,Constable
An enumeration of the different "endianness" states. "Endianness" refers to the order in which bytes
are stored in memory.
For now, this enumeration is essentially a wrapper around an existing enumeration, ByteOrder
.
The reason for this is primarily that ByteOrder
is not actually an enum
,
but rather a final class
with two constant instances as static members since enum
s
were introduced in Java 1.5, after ByteOrder
was created. The benefit of an enum
is that the compiler understands that no more instances of this class will ever be created, allowing for
more convenient logic in many cases (particularly when using switch
expressions).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe bytes of a multibyte value are ordered from most significant to least significant.The bytes of a multibyte value are ordered from least significant to most significant. -
Method Summary
Modifier and TypeMethodDescriptionGet the Java standard library representation of this endianness value.static Endianness
Returns the enum constant of this class with the specified name.static Endianness[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BIG_ENDIAN
The bytes of a multibyte value are ordered from most significant to least significant. -
LITTLE_ENDIAN
The bytes of a multibyte value are ordered from least significant to most significant.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getByteOrder
Get the Java standard library representation of this endianness value.- Returns:
- The
ByteOrder
variant corresponding to this value.
-