cz.cuni.amis.utils
Class GenericLoader<T>

Package class diagram package GenericLoader
java.lang.Object
  extended by cz.cuni.amis.utils.GenericLoader<T>

public class GenericLoader<T>
extends Object


Constructor Summary
GenericLoader()
           
 
Method Summary
 T loadObject(File file)
          Loads the object of type T from file 'file'.
 T loadObject(InputStream in)
          Loads the object of type T from input stream.
 T loadObject(String pathAndFileName)
          Loads the object of type T from the file at path 'pathAndFileName'.
 boolean saveObject(T object, File file)
          Writes object to the file;
 boolean saveObject(T object, ObjectOutputStream out)
          Writes object to the output stream, returns success
 boolean saveObject(T object, OutputStream out)
          Writes object to the output stream, returns success.
 boolean saveObject(T object, String pathAndFileName)
          Writes object to the file at 'pathAndFileName';
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericLoader

public GenericLoader()
Method Detail

loadObject

public T loadObject(InputStream in)
Loads the object of type T from input stream.

Parameters:
in -
Returns:
null (failure) || loaded object

loadObject

public T loadObject(File file)
Loads the object of type T from file 'file'.

Parameters:
file -
Returns:
null (failure) || loaded object

loadObject

public T loadObject(String pathAndFileName)
Loads the object of type T from the file at path 'pathAndFileName'.

Parameters:
pathAndFileName -
Returns:
null (failure) || loaded object

saveObject

public boolean saveObject(T object,
                          ObjectOutputStream out)
Writes object to the output stream, returns success

Parameters:
object -
out -
Returns:
success

saveObject

public boolean saveObject(T object,
                          OutputStream out)
Writes object to the output stream, returns success.

Parameters:
object -
out -
Returns:
success

saveObject

public boolean saveObject(T object,
                          File file)
Writes object to the file;

Parameters:
object -
file -
Returns:
success

saveObject

public boolean saveObject(T object,
                          String pathAndFileName)
Writes object to the file at 'pathAndFileName';

Parameters:
object -
pathAndFileName -
Returns:
success


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.