Class ProfileDB
java.lang.Object
org.apache.wayang.commons.util.profiledb.ProfileDB
This class provides facilities to save and load
Experiment
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(Collection<Experiment> experiments) Related to file based storage, Receive a Collection ofExperiment
s and persist them at the end of a filevoid
append
(Experiment... experiments) Related to file based storage, Receive an array ofExperiment
s and persist them at the end of a filecom.google.gson.Gson
getGson()
Provide aGson
object.To work with storage object provided to persist or load experimentsload()
BringExperiment
s from current Storage to local variableload
(InputStream inputStream) BringExperiment
s from current Storage to local variableregisterMeasurementClass
(Class<? extends Measurement> measurementClass) Register aMeasurement
type.void
save
(Collection<Experiment> experiments) Receive a Collection ofExperiment
s and persist themvoid
save
(Collection<Experiment> experiments, OutputStream outputStream) Receive a Collection ofExperiment
s and persist themvoid
save
(Experiment... experiments) Receive an array ofExperiment
s and persist themwithGsonPreparation
(Consumer<com.google.gson.GsonBuilder> preparation) Apply any changes necessary toGson
so that it can be used for de/serialization of custom objects.
-
Constructor Details
-
ProfileDB
Creates a new instance.
-
-
Method Details
-
save
Receive an array ofExperiment
s and persist them- Parameters:
experiments
- Array ofExperiment
s to be persisted- Throws:
IOException
-
save
Receive a Collection ofExperiment
s and persist them- Parameters:
experiments
- Collection ofExperiment
s to be persisted- Throws:
IOException
-
save
Receive a Collection ofExperiment
s and persist them- Parameters:
experiments
- Collection ofExperiment
s to be persistedoutputStream
- Indicates where the data must to be written- Throws:
IOException
-
append
Related to file based storage, Receive an array ofExperiment
s and persist them at the end of a file- Parameters:
experiments
- Array ofExperiment
s to be persisted- Throws:
IOException
-
append
Related to file based storage, Receive a Collection ofExperiment
s and persist them at the end of a file- Parameters:
experiments
- Collection ofExperiment
s to be persisted- Throws:
IOException
-
load
BringExperiment
s from current Storage to local variable- Returns:
- Collection of
Experiment
s - Throws:
IOException
-
load
BringExperiment
s from current Storage to local variable- Parameters:
inputStream
- Data to be read- Returns:
- Collection of
Experiment
s - Throws:
IOException
-
getStorage
To work with storage object provided to persist or load experiments- Returns:
- Storage object proportioned for this instance
-
registerMeasurementClass
Register aMeasurement
type. This is required before being able to load that type.- Parameters:
measurementClass
- theMeasurement
Class
- Returns:
- this instance
-
withGsonPreparation
Apply any changes necessary toGson
so that it can be used for de/serialization of custom objects.- Parameters:
preparation
- a preparatory step performed on aGsonBuilder
- Returns:
- this instance
-
getGson
public com.google.gson.Gson getGson()Provide aGson
object.- Returns:
- the
Gson
object
-