Package com.powsybl.timeseries
Class UncompressedDoubleDataChunk
- java.lang.Object
-
- com.powsybl.timeseries.AbstractUncompressedDataChunk
-
- com.powsybl.timeseries.UncompressedDoubleDataChunk
-
- All Implemented Interfaces:
DataChunk<DoublePoint,DoubleDataChunk>
,DoubleDataChunk
public class UncompressedDoubleDataChunk extends AbstractUncompressedDataChunk implements DoubleDataChunk
- Author:
- Geoffroy Jamgotchian
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.powsybl.timeseries.DataChunk
DataChunk.JsonParsingContext, DataChunk.Split<P extends AbstractPoint,A extends DataChunk<P,A>>
-
-
Field Summary
-
Fields inherited from class com.powsybl.timeseries.AbstractUncompressedDataChunk
offset
-
-
Constructor Summary
Constructors Constructor Description UncompressedDoubleDataChunk(int offset, double[] values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleDataChunk
append(DoubleDataChunk otherChunk)
Append the chunk with the one given in argument, and return the result.boolean
equals(Object obj)
void
fillBuffer(BigDoubleBuffer buffer, long timeSeriesOffset)
void
fillBuffer(DoubleBuffer buffer, int timeSeriesOffset)
TimeSeriesDataType
getDataType()
Get data type.int
getEstimatedSize()
Get estimated size in bytes.int
getLength()
Get data chunk lengthdouble[]
getValues()
int
hashCode()
Iterator<DoublePoint>
iterator(TimeSeriesIndex index)
Get a point iterator.DataChunk.Split<DoublePoint,DoubleDataChunk>
splitAt(int splitIndex)
Split the chunk in two parts.Stream<DoublePoint>
stream(TimeSeriesIndex index)
Get a point stream.DoubleDataChunk
tryToCompress()
Try to compress the chunk.protected void
writeValuesJson(com.fasterxml.jackson.core.JsonGenerator generator)
-
Methods inherited from class com.powsybl.timeseries.AbstractUncompressedDataChunk
getCompressionFactor, getOffset, isCompressed, toJson, writeJson
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.powsybl.timeseries.DataChunk
getCompressionFactor, getOffset, isCompressed, toJson, writeJson
-
-
-
-
Method Detail
-
getValues
public double[] getValues()
-
getLength
public int getLength()
Description copied from interface:DataChunk
Get data chunk length- Specified by:
getLength
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Returns:
- data chunk length
-
getEstimatedSize
public int getEstimatedSize()
Description copied from interface:DataChunk
Get estimated size in bytes.- Specified by:
getEstimatedSize
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Returns:
- estimated size in bytes
-
getDataType
public TimeSeriesDataType getDataType()
Description copied from interface:DataChunk
Get data type.- Specified by:
getDataType
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Returns:
- the data type
-
fillBuffer
public void fillBuffer(DoubleBuffer buffer, int timeSeriesOffset)
- Specified by:
fillBuffer
in interfaceDoubleDataChunk
-
fillBuffer
public void fillBuffer(BigDoubleBuffer buffer, long timeSeriesOffset)
- Specified by:
fillBuffer
in interfaceDoubleDataChunk
-
tryToCompress
public DoubleDataChunk tryToCompress()
Description copied from interface:DataChunk
Try to compress the chunk.- Specified by:
tryToCompress
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Returns:
- the compressed chunk or itself if compression is not efficient enough
-
splitAt
public DataChunk.Split<DoublePoint,DoubleDataChunk> splitAt(int splitIndex)
Description copied from interface:DataChunk
Split the chunk in two parts.- Specified by:
splitAt
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Parameters:
splitIndex
- the split index- Returns:
- both chunks
-
append
public DoubleDataChunk append(DoubleDataChunk otherChunk)
Description copied from interface:DataChunk
Append the chunk with the one given in argument, and return the result. "This" dataChunk and the one in argument remain unchanged. The two chunks have to be successive, i.e : this.getOffset() + this.length() = otherChunk.getOffset()- Specified by:
append
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Parameters:
otherChunk
- : the chunk to append with this object. It has to be the same implementation as this object.- Returns:
-
stream
public Stream<DoublePoint> stream(TimeSeriesIndex index)
Description copied from interface:DataChunk
Get a point stream.- Specified by:
stream
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Parameters:
index
- the time series index- Returns:
- a point stream
-
iterator
public Iterator<DoublePoint> iterator(TimeSeriesIndex index)
Description copied from interface:DataChunk
Get a point iterator.- Specified by:
iterator
in interfaceDataChunk<DoublePoint,DoubleDataChunk>
- Parameters:
index
- the time series index- Returns:
- a point iterator
-
writeValuesJson
protected void writeValuesJson(com.fasterxml.jackson.core.JsonGenerator generator) throws IOException
- Specified by:
writeValuesJson
in classAbstractUncompressedDataChunk
- Throws:
IOException
-
-