Enum Class SystemIO.SeekWhence

java.lang.Object
java.lang.Enum<SystemIO.SeekWhence>
mars.simulator.SystemIO.SeekWhence
All Implemented Interfaces:
Serializable, Comparable<SystemIO.SeekWhence>, Constable
Enclosing class:
SystemIO

public static enum SystemIO.SeekWhence extends Enum<SystemIO.SeekWhence>
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.
  • Enum Constant Details

    • FROM_START

      public static final SystemIO.SeekWhence FROM_START
      The file offset is set to offset bytes.
    • FROM_CURRENT

      public static final SystemIO.SeekWhence FROM_CURRENT
      The file offset is set to its current position plus offset bytes.
    • FROM_END

      public static final SystemIO.SeekWhence FROM_END
      The file offset is set to the size of the file plus offset bytes.
  • Method Details

    • values

      public static SystemIO.SeekWhence[] 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

      public static SystemIO.SeekWhence valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getOrdinal

      public int getOrdinal()
      Get the internal integer value associated with this "whence" value.
      Returns:
      The integer ordinal.
    • valueOf

      public static SystemIO.SeekWhence valueOf(int ordinal)
      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.