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

net.sixpointsix.carpo.common.model.DataPointRow Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package net.sixpointsix.carpo.common.model;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Wrapper for a row of data in the extraction
 *
 * @author Andrew Tarry
 * @since 0.2.0
 */
public class DataPointRow {

    private final List dataPoints;

    public DataPointRow(List dataPoints) {
        this.dataPoints = dataPoints;
    }

    /**
     * Get the data as a list
     * @return list of data
     */
    public List getDataPoints() {
        return dataPoints;
    }

    /**
     * Get the data as a stream
     * @return stream of data
     */
    public Stream stream() {
        return dataPoints.stream();
    }

    /**
     * Get all the values from the data points
     * @return list of values
     */
    public List getValues() {
        return stream()
                .map(DataPoint::getValue)
                .collect(Collectors.toList());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy