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()]); }
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()]); }
private void addMetadata(Dataset dataset) { for (DatasetMetadataBean metadataBean : metadata) { DataKey key = metadataBean.extractDataKey(); MetadataMap meta = (MetadataMap) metadataBean.extractMetadata(); dataset.addMetadata(key, meta); } }
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(); }