|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.problem.dataset.DataSetManager
public final class DataSetManager
This class is a Singleton and is responsible for managing all the DataSet
s and
DataSetBuilder
s that might be instantiated by a Simulation
,
Problem
or Thread
. It prevents the same dataset or dataset builder from
being parsed or initialised more than once. It achieves this by maintaining two
Hashtable
s. The first, datasets
(with its key
the
identifier of the dataset and its value
an ArrayList
of
ClusterableDataSet.Pattern
s that have been returned by the LocalDataSet.parseDataSet()
method) makes sure that a specific dataset is parsed and instantiated only once.
The second, builders
(with its key
the identifier of the dataset
builder and its value
the AssociatedPairDataSetBuilder
object)
makes sure that a specific dataset builder is built and initialised only once.
The
concrete LocalDataSet
is used, but only for now, because I didn't want to change
the more generic DataSet
.
The concrete AssociatedPairDataSetBuilder
is
used, but only for now, because I didn't want to change the more generic
DataSetBuilder
.
Method Summary | |
---|---|
ArrayList<ClusterableDataSet.Pattern> |
getDataFromSet(LocalDataSet dataset)
Either parse and retrieve or just retrieve the list of patterns that represents the requested dataset. |
AssociatedPairDataSetBuilder |
getDataSetBuilder(AssociatedPairDataSetBuilder datasetBuilder)
Either initialise and retrieve or just retrieve the object that represents the requested built up dataset. |
static DataSetManager |
getInstance()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DataSetManager getInstance()
public ArrayList<ClusterableDataSet.Pattern> getDataFromSet(LocalDataSet dataset)
LocalDataSet
) is used as the key into the datasets
Hashtable
.
dataset
- a LocalDataSet
that may or may not have been
parsed/instantiated before
ArrayList
of ClusterableDataSet.Pattern
s representing the given datasetpublic AssociatedPairDataSetBuilder getDataSetBuilder(AssociatedPairDataSetBuilder datasetBuilder)
builders
Hashtable
.
datasetBuilder
- an AssociatedPairDataSetBuilder
that may or may not have
been built/instantiated before
AssociatedPairDataSetBuilder
that represent the requested built up
dataset
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |