org.planx.io
Interface Positionable

All Known Subinterfaces:
PositionalData, PositionalDataInput, PositionalDataOutput
All Known Implementing Classes:
AbstractPositionalData, ByteData, FileData

public interface Positionable

A data source that is positionable using longs or Locators and has an associated SourceId.

Author:
Thomas Ambus

Method Summary
 SourceId id()
          Returns the current SourceId associated with the data.
 Locator location()
          Returns the current position in the data as a Locator.
 long position()
          Returns the current position in the data as an long.
 void seek(Locator locator)
          Positions the data source at the specified locator.
 void seek(long position)
          Positions the data source at the specified position.
 

Method Detail

id

SourceId id()
            throws IOException
Returns the current SourceId associated with the data. That is, the SourceId of the Locator that will currently be returned by the location() method.

Throws:
IOException

location

Locator location()
                 throws IOException
Returns the current position in the data as a Locator.

Throws:
IOException - if an I/O error occurred.

position

long position()
              throws IOException
Returns the current position in the data as an long.

Throws:
IOException - if an I/O error occurred.

seek

void seek(Locator locator)
          throws IOException,
                 InvalidSourceIdException,
                 OutOfBoundsException
Positions the data source at the specified locator.

Throws:
IOException - if an I/O error occurred.
InvalidSourceIdException
OutOfBoundsException

seek

void seek(long position)
          throws IOException,
                 OutOfBoundsException
Positions the data source at the specified position.

Throws:
IOException - if an I/O error occurred.
OutOfBoundsException


Copyright © 2004-2005 Plan-X. All Rights Reserved.