org.diirt.datasource.timecache.query.QueryDataComplete Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datasource-timecache Show documentation
Show all versions of datasource-timecache Show documentation
Local cache for time series gathered from multiple sources.
The newest version!
/**
* Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT
* All rights reserved. Use is subject to license terms. See LICENSE.TXT
*/
package org.diirt.datasource.timecache.query;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.SortedMap;
import org.diirt.util.time.TimeInterval;
import org.diirt.util.time.Timestamp;
import org.diirt.vtype.VType;
/**
* Represents a completed chunk with all data available.
* @author Fred Arnaud (Sopra Group) - ITER
*/
public class QueryDataComplete implements QueryData {
private final TimeInterval timeInterval;
private final SortedMap dataMap;
QueryDataComplete(TimeInterval timeInterval, SortedMap dataMap) {
this.dataMap = Collections.unmodifiableSortedMap(dataMap);
this.timeInterval = timeInterval;
}
/** {@inheritDoc} */
@Override
public TimeInterval getTimeInterval() {
return timeInterval;
}
/** {@inheritDoc} */
@Override
public int getCount() {
return dataMap.size();
}
/** {@inheritDoc} */
@Override
public List getData() {
return new ArrayList(dataMap.values());
}
/** {@inheritDoc} */
@Override
public List getTimestamps() {
return new ArrayList(dataMap.keySet());
}
}