net.sixpointsix.carpo.common.model.DataPointRow Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of carpo-common Show documentation
Show all versions of carpo-common Show documentation
Common until library for carpo
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());
}
}