Exemple #1
0
 private static void addFiles(Dataset dataset, DatasetBean bean) {
   List<DatasetFileBean> fileBeans = new ArrayList<DatasetFileBean>();
   List<DataKey> sorted = new ArrayList<DataKey>(dataset.getAllFileKeys());
   Collections.sort(sorted);
   for (DataKey key : sorted) {
     DataFile file = dataset.getFile(key);
     DatasetFileBean fileBean = DatasetFileBean.instance(key, file);
     fileBeans.add(fileBean);
   }
   bean.files = fileBeans.toArray(new DatasetFileBean[fileBeans.size()]);
 }
Exemple #2
0
 private static void addMetadata(Dataset dataset, DatasetBean bean) {
   List<DatasetMetadataBean> metadataBeans = new ArrayList<DatasetMetadataBean>();
   List<DataKey> sorted = new ArrayList<DataKey>(dataset.getAllMetadataKeys());
   Collections.sort(sorted);
   for (DataKey key : sorted) {
     MetadataMap metadata = dataset.getMetadata(key);
     DatasetMetadataBean metadataBean = DatasetMetadataBean.instance(key, metadata);
     metadataBeans.add(metadataBean);
   }
   bean.metadata = metadataBeans.toArray(new DatasetMetadataBean[metadataBeans.size()]);
 }
Exemple #3
0
 private void addMetadata(Dataset dataset) {
   for (DatasetMetadataBean metadataBean : metadata) {
     DataKey key = metadataBean.extractDataKey();
     MetadataMap meta = (MetadataMap) metadataBean.extractMetadata();
     dataset.addMetadata(key, meta);
   }
 }
Exemple #4
0
 private void addFiles(Dataset dataset) {
   for (DatasetFileBean fileBean : files) {
     DataKey key = fileBean.extractDataKey();
     DataFile file = fileBean.extractDataFile();
     dataset.addFile(key, file);
   }
 }
 protected Collection<DataKey> getSortedFileKeys(Dataset dataset) {
   return dataset.getAllFileKeys();
 }