fr.cnes.sirius.patrius.tools.ephemerisComparator
Class AbstractDataLoader

java.lang.Object
  extended by fr.cnes.sirius.patrius.tools.ephemerisComparator.AbstractDataLoader
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PSimuDataLoader

public abstract class AbstractDataLoader
extends Object
implements Serializable

This abstract class is the base for a DataLoader.

With this class, one can get a stream out of a text file.

In order to use it, one has to develop his own subclass, or use one of the provided subclasses

Since:
1.0
Version:
$Id: AbstractDataLoader.java 6320 2012-09-20 15:36:28Z CardosoP $
Author:
Philippe Pavero
See Also:
MediaSize.NA, Serialized Form
Concurrency :
not thread-safe
Concurrency comment :
the file could be tampered with while reading it

Constructor Summary
AbstractDataLoader()
           
 
Method Summary
abstract  Data<Double> getData(BufferedReader reader)
          parses the text reader to a Data object.
 BufferedReader getStream(File ephemerisFile)
          Produces a BufferedReader from a File object.
 BufferedReader getStream(URL url)
          Produces a BufferedReader from a url to a text file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataLoader

public AbstractDataLoader()
Method Detail

getStream

public final BufferedReader getStream(File ephemerisFile)
                               throws EphemerisComparatorException
Produces a BufferedReader from a File object.

Parameters:
ephemerisFile - the file representing the text file to load
Returns:
reader a buffered reader to the text file
Throws:
EphemerisComparatorException - when the file can not be found
Since:
1.0

getStream

public final BufferedReader getStream(URL url)
                               throws EphemerisComparatorException
Produces a BufferedReader from a url to a text file.

Parameters:
url - the url to the text file to load
Returns:
reader a buffered reader to the text file
Throws:
EphemerisComparatorException - when the file can not be found
Since:
1.0

getData

public abstract Data<Double> getData(BufferedReader reader)
                              throws IOException
parses the text reader to a Data object.

Parameters:
reader - a BufferedReader to a text file
Returns:
an object that contains all the data from the text file
Throws:
IOException - if there is a problem during the reading
Since:
1.0


Copyright © 2016 CNES. All Rights Reserved.