org.deegree.services.wpvs.io.file
Class DataFile<T extends 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 PositionableModel>
extends Object

The DataFile class TODO add class documentation here.

Version:
$Revision: 29642 $, $Date: 2011-02-11 13:59:33 +0100 (Fri, 11 Feb 2011) $
Author:
Rutger Bezema, last edited by: $Author: lbuesching $

Constructor Summary
DataFile(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)
           
 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(File dataFile,
                ObjectSerializer<T> serializer)
         throws IOException
Parameters:
dataFile -
serializer - to use for serialization.
Throws:
IOException
Method Detail

get

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

add

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

close

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

Throws:
IOException

getSize

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

getFileName

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


Copyright © 2011. All Rights Reserved.