org.deegree.services.wpvs.io.file
Class DataFile<T extends org.deegree.commons.index.PositionableModel>

java.lang.Object
  extended by org.deegree.services.wpvs.io.file.DataFile<T>
Type Parameters:
T - to add to the file

public class DataFile<T extends org.deegree.commons.index.PositionableModel>
extends java.lang.Object

The DataFile class TODO add class documentation here.

Version:
$Revision: 23246 $, $Date: 2010-03-25 10:49:16 +0100 (Do, 25. Mär 2010) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Constructor Summary
DataFile(java.io.File dataFile, ObjectSerializer<T> serializer)
           
 
Method Summary
 long add(DataObjectInfo<T> object)
           
 void close()
          Closes the file and writes all data to it.
 DataObjectInfo<T> get(long position)
           
 java.lang.String getFileName()
           
 long getSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataFile

public DataFile(java.io.File dataFile,
                ObjectSerializer<T> serializer)
         throws java.io.IOException
Parameters:
dataFile -
serializer - to use for serialization.
Throws:
java.io.IOException
Method Detail

get

public DataObjectInfo<T> get(long position)
                                                                          throws java.io.IOException
Parameters:
position -
Returns:
the object from the file.
Throws:
java.io.IOException

add

public long add(DataObjectInfo<T> object)
         throws java.io.IOException
Parameters:
object -
Returns:
the position of the billboard in the data file.
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the file and writes all data to it.

Throws:
java.io.IOException

getSize

public long getSize()
Returns:
the next write position.

getFileName

public java.lang.String getFileName()
Returns:
the path of this datafile


Copyright © 2011. All Rights Reserved.