Enum Class FileStatus

java.lang.Object
java.lang.Enum<FileStatus>
mars.venus.editor.FileStatus
All Implemented Interfaces:
Serializable, Comparable<FileStatus>, Constable

public enum FileStatus extends Enum<FileStatus>
Used to store and return information on the status of the current ASM file that is being edited in the program.
Author:
Team JSpim
  • Enum Constant Details

    • NO_FILE

      public static final FileStatus NO_FILE
      No files are open (this only applies to the menu state in VenusUI).
    • NEW_NOT_EDITED

      public static final FileStatus NEW_NOT_EDITED
      Newly created file with no edits.
    • NEW_EDITED

      public static final FileStatus NEW_EDITED
      Newly created file with unsaved edits.
    • NOT_EDITED

      public static final FileStatus NOT_EDITED
      File from disk with no edits.
    • EDITED

      public static final FileStatus EDITED
      File from disk with unsaved edits.
  • Method Details

    • values

      public static FileStatus[] 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 FileStatus 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
    • isNew

      public boolean isNew()
      Determine whether file is "new", which means created using New but not yet saved. If created using Open, it is not new.
      Returns:
      true if file was created using New and has not yet been saved, false otherwise.
    • hasUnsavedEdits

      public boolean hasUnsavedEdits()
      Determine whether file has been modified since last save or, if not yet saved, since being created using New or Open.
      Returns:
      true if file has been modified since save or creation, false otherwise.