Package mars.simulator
Enum Class SystemIO.SeekWhence
- All Implemented Interfaces:
Serializable
,Comparable<SystemIO.SeekWhence>
,Constable
- Enclosing class:
- SystemIO
Enumeration of locations whence to seek from in a file. This provides context for an integer
offset
, informing the system of the initial position the offset is based on.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe file offset is set to its current position plusoffset
bytes.The file offset is set to the size of the file plusoffset
bytes.The file offset is set tooffset
bytes. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the internal integer value associated with this "whence" value.static SystemIO.SeekWhence
valueOf
(int ordinal) Find the "whence" value, if any, corresponding to a given internal integer value.static SystemIO.SeekWhence
Returns the enum constant of this class with the specified name.static SystemIO.SeekWhence[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FROM_START
The file offset is set tooffset
bytes. -
FROM_CURRENT
The file offset is set to its current position plusoffset
bytes. -
FROM_END
The file offset is set to the size of the file plusoffset
bytes.
-
-
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
-
getOrdinal
public int getOrdinal()Get the internal integer value associated with this "whence" value.- Returns:
- The integer ordinal.
-
valueOf
Find the "whence" value, if any, corresponding to a given internal integer value.- Parameters:
ordinal
- The integer ordinal to find the "whence" value for.- Returns:
- The "whence" value, if one was found, or
null
otherwise.
-