Enum OpenMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<OpenMode>, java.lang.constant.Constable

    public enum OpenMode
    extends java.lang.Enum<OpenMode>
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Enum

        java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      APPEND
      Force all writes to append data at the end of the file.
      CREAT
      If this flag is specified, then a new file will be created if one does not already exist (if TRUNC is specified, the new file will be truncated to zero length if it previously exists).
      EXCL
      Causes the request to fail if the named file already exists.
      READ
      Open the file for reading.
      TRUNC
      Forces an existing file with the same name to be truncated to zero length when creating a file by specifying CREAT.
      WRITE
      Open the file for writing.
    • Method Summary

      Modifier and Type Method Description
      static int toMask​(java.util.Set<OpenMode> modes)  
      static OpenMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static OpenMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • READ

        public static final OpenMode READ
        Open the file for reading.
      • WRITE

        public static final OpenMode WRITE
        Open the file for writing. If both this and READ are specified, the file is opened for both reading and writing.
      • APPEND

        public static final OpenMode APPEND
        Force all writes to append data at the end of the file.
      • CREAT

        public static final OpenMode CREAT
        If this flag is specified, then a new file will be created if one does not already exist (if TRUNC is specified, the new file will be truncated to zero length if it previously exists).
      • TRUNC

        public static final OpenMode TRUNC
        Forces an existing file with the same name to be truncated to zero length when creating a file by specifying CREAT. CREAT MUST also be specified if this flag is used.
      • EXCL

        public static final OpenMode EXCL
        Causes the request to fail if the named file already exists. CREAT MUST also be specified if this flag is used.
    • Method Detail

      • values

        public static OpenMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared.
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OpenMode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toMask

        public static int toMask​(java.util.Set<OpenMode> modes)