DATASET
- Type of sub-datasets.INSTANCE
- Type of objects in the datasetpublic static class MapBackedDataset.IdentifiableBuilder<DATASET extends Dataset<INSTANCE> & Identifiable,INSTANCE> extends Object
MapBackedDataset
instances from
Identifiable
sub-datasets. Example:
final MapBackedDatasetFor small, String> ds = new MapBackedDataset.IdentifiableBuilder , String>() .add(new VFSListDataset (...)) .add(new VFSListDataset (...)) .build();
MapBackedDataset
s, the MapBackedDataset.of()
methods are even more convenient.
Builder instances can be reused - it is safe to call build()
multiple times to build multiple maps in series. Each map is a superset
of the maps created before it.
Constructor and Description |
---|
IdentifiableBuilder() |
Modifier and Type | Method and Description |
---|---|
MapBackedDataset.IdentifiableBuilder<DATASET,INSTANCE> |
add(DATASET dataset)
Add the sub-dataset such that it becomes a group in the
MapBackedDataset returned by build() where the key
is the identifier returned by Identifiable.getID() . |
MapBackedDataset<String,DATASET,INSTANCE> |
build()
Returns a newly-created
MapBackedDataset . |
public IdentifiableBuilder()
public MapBackedDataset.IdentifiableBuilder<DATASET,INSTANCE> add(DATASET dataset)
MapBackedDataset
returned by build()
where the key
is the identifier returned by Identifiable.getID()
.
If duplicate keys (i.e. sub-datasets with duplicate identifiers) are
added, only the last one will appear in the resultant dataset
produced by build()
.
dataset
- the sub-dataset to addpublic MapBackedDataset<String,DATASET,INSTANCE> build()
MapBackedDataset
.MapBackedDataset
.