com.bigdata.journal
Enum ForceEnum

java.lang.Object
  extended by java.lang.Enum<ForceEnum>
      extended by com.bigdata.journal.ForceEnum
All Implemented Interfaces:
Serializable, Comparable<ForceEnum>

public enum ForceEnum
extends Enum<ForceEnum>

Type safe enumeration of options governing whether and how a file is forced to stable storage. This enum is used for a variety of behaviors, including commit semantics and the mode in which the RandomAccessFile is opened.

Version:
$Id: ForceEnum.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Enum Constant Summary
Force
          The file data, but NOT the file metadata, are forced to stable storage.
ForceMetadata
          The file data and the file metadata are forced to stable storage.
No
          The file is not forced to stable storage.
 
Method Summary
 String asFileMode()
          Return the read-write file mode corresponding to the enum value.
static ForceEnum parse(String s)
          Parse a string whose contents must be "No", "Force", "ForceMetadata".
 String toString()
           
static ForceEnum valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ForceEnum[] 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

No

public static final ForceEnum No
The file is not forced to stable storage.


Force

public static final ForceEnum Force
The file data, but NOT the file metadata, are forced to stable storage.

See Also:
FileChannel.force(boolean)

ForceMetadata

public static final ForceEnum ForceMetadata
The file data and the file metadata are forced to stable storage.

See Also:
FileChannel.force(boolean)
Method Detail

values

public static ForceEnum[] 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 (ForceEnum c : ForceEnum.values())
    System.out.println(c);

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

valueOf

public static ForceEnum 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

toString

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

parse

public static ForceEnum parse(String s)
Parse a string whose contents must be "No", "Force", "ForceMetadata".

Parameters:
s - The string.
Returns:
The named ForceEnum.

asFileMode

public String asFileMode()
Return the read-write file mode corresponding to the enum value.

See Also:
RandomAccessFile.RandomAccessFile(java.io.File, String)
TODO:
Write unit test.


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.