org.entityfs.support.io
Enum RandomAccessMode

java.lang.Object
  extended by java.lang.Enum<RandomAccessMode>
      extended by org.entityfs.support.io.RandomAccessMode
All Implemented Interfaces:
Serializable, Comparable<RandomAccessMode>

public enum RandomAccessMode
extends Enum<RandomAccessMode>

This is an enumeration over the different modes that a file can be opened for random access in.

Since:
1.0
Author:
Karl Gustafsson
See Also:
RandomlyAccessibleFile

Enum Constant Summary
READ_ONLY
           
READ_WRITE
           
READ_WRITE_SYNCHRONOUS_CONTENTS
           
READ_WRITE_SYNCHRONOUSLY
           
 
Method Summary
 String getTag()
          Get the mode tag as defined in java.io.RandomAccessFile, for instance "rw" for read/write.
 boolean isReadOnly()
          Is this access mode read only?
 String toString()
           
static RandomAccessMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static RandomAccessMode[] 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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

READ_ONLY

public static final RandomAccessMode READ_ONLY

READ_WRITE

public static final RandomAccessMode READ_WRITE

READ_WRITE_SYNCHRONOUSLY

public static final RandomAccessMode READ_WRITE_SYNCHRONOUSLY

READ_WRITE_SYNCHRONOUS_CONTENTS

public static final RandomAccessMode READ_WRITE_SYNCHRONOUS_CONTENTS
Method Detail

values

public static RandomAccessMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (RandomAccessMode c : RandomAccessMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RandomAccessMode valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isReadOnly

public boolean isReadOnly()
Is this access mode read only?

Returns:
true if the access mode is read only, false if it is read/write.

getTag

public String getTag()
Get the mode tag as defined in java.io.RandomAccessFile, for instance "rw" for read/write.

Returns:
The mode tag.

toString

public String toString()
Overrides:
toString in class Enum<RandomAccessMode>