au.com.prunge.jgenfile
Class FileAccessorOptions.OffsetMode

java.lang.Object
  |
  +--au.com.prunge.jgenfile.FileAccessorOptions.OffsetMode
Enclosing class:
FileAccessorOptions

public static class FileAccessorOptions.OffsetMode
extends Object

Class to represent different offset modes. To get an instance of this class, use the START_OF_FILE or END_OF_FILE constants or use the createAbsolutePositionMode to create an offset mode with a specified position in the file.

Version:
1.0
Author:
Peter Runge

Field Summary
static FileAccessorOptions.OffsetMode END_OF_FILE
          Offset mode to indicate the file accessor should create channels with an initial position at the end of the file.
static FileAccessorOptions.OffsetMode START_OF_FILE
          Offset mode to indicate the file accessor should create channels with an initial position at the start of the file.
 
Method Summary
static FileAccessorOptions.OffsetMode createAbsolutePositionMode(long position)
          Creates an offset mode that indicates the file accessor should create channels with an initial position of position in the file.
 long getPosition()
          Returns the position of the offset mode or -1 if position is not specified.
 String toString()
          Returns a string representation of this offset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

START_OF_FILE

public static final FileAccessorOptions.OffsetMode START_OF_FILE
Offset mode to indicate the file accessor should create channels with an initial position at the start of the file.


END_OF_FILE

public static final FileAccessorOptions.OffsetMode END_OF_FILE
Offset mode to indicate the file accessor should create channels with an initial position at the end of the file. This is the append mode.

Method Detail

createAbsolutePositionMode

public static FileAccessorOptions.OffsetMode createAbsolutePositionMode(long position)
                                                                 throws IllegalArgumentException
Creates an offset mode that indicates the file accessor should create channels with an initial position of position in the file.

Parameters:
position - the position in the file.
Throws:
IllegalArgumentException - if position is negative.

getPosition

public long getPosition()
Returns the position of the offset mode or -1 if position is not specified.


toString

public String toString()
Returns a string representation of this offset.

Overrides:
toString in class Object