All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.diirt.datasource.timecache.query.QueryDataComplete Maven / Gradle / Ivy

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());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy