Package com.powsybl.timeseries
Interface DataChunk<P extends AbstractPoint,A extends DataChunk<P,A>>
- All Known Subinterfaces:
DoubleDataChunk
,StringDataChunk
- All Known Implementing Classes:
CompressedDoubleDataChunk
,CompressedStringDataChunk
,UncompressedDoubleDataChunk
,UncompressedStringDataChunk
public interface DataChunk<P extends AbstractPoint,A extends DataChunk<P,A>>
- Author:
- Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static class
DataChunk.Split<P extends AbstractPoint,
A extends DataChunk<P, A>> -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
Append the chunk with the one given in argument, and return the result.static DoubleDataChunk
create
(double... values) static DoubleDataChunk
create
(int offset, double[] values) static StringDataChunk
static StringDataChunk
double
Get compression factor. 1 means no compression.Get data type.int
Get estimated size in bytes.int
Get data chunk lengthint
Get data chunk offset.boolean
Check if chunk is in compressed form.iterator
(TimeSeriesIndex index) Get a point iterator.static void
static void
parseFieldName
(com.fasterxml.jackson.core.JsonParser parser, DataChunk.JsonParsingContext context) static void
parseJson
(com.fasterxml.jackson.core.JsonParser parser, List<DoubleDataChunk> doubleChunks, List<StringDataChunk> stringChunks) static void
parseJson
(com.fasterxml.jackson.core.JsonParser parser, List<DoubleDataChunk> doubleChunks, List<StringDataChunk> stringChunks, boolean single) static void
parseValueNumberInt
(com.fasterxml.jackson.core.JsonParser parser, DataChunk.JsonParsingContext context) splitAt
(int splitIndex) Split the chunk in two parts.stream
(TimeSeriesIndex index) Get a point stream.toJson()
Try to compress the chunk.void
writeJson
(com.fasterxml.jackson.core.JsonGenerator generator) Serialize this data chunk to json.static void
Serialize a chunk list to json
-
Method Details
-
getOffset
int getOffset()Get data chunk offset.- Returns:
- data chunk offset
-
getLength
int getLength()Get data chunk length- Returns:
- data chunk length
-
getEstimatedSize
int getEstimatedSize()Get estimated size in bytes.- Returns:
- estimated size in bytes
-
getCompressionFactor
double getCompressionFactor()Get compression factor. 1 means no compression.- Returns:
- the compression factor
-
isCompressed
boolean isCompressed()Check if chunk is in compressed form.- Returns:
- true if chunk is in compressed form, false otherwise
-
getDataType
TimeSeriesDataType getDataType()Get data type.- Returns:
- the data type
-
stream
Get a point stream.- Parameters:
index
- the time series index- Returns:
- a point stream
-
iterator
Get a point iterator.- Parameters:
index
- the time series index- Returns:
- a point iterator
-
tryToCompress
A tryToCompress()Try to compress the chunk.- Returns:
- the compressed chunk or itself if compression is not efficient enough
-
splitAt
Split the chunk in two parts.- Parameters:
splitIndex
- the split index- Returns:
- both chunks
-
append
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()- Parameters:
otherChunk
- the chunk to append with this object. It has to be the same implementation as this object.
-
writeJson
void writeJson(com.fasterxml.jackson.core.JsonGenerator generator) Serialize this data chunk to json.- Parameters:
generator
- a json generator (jackson)
-
create
-
create
-
create
-
create
-
writeJson
static void writeJson(com.fasterxml.jackson.core.JsonGenerator generator, List<? extends DataChunk> chunks) Serialize a chunk list to json- Parameters:
generator
- a json generator (jackson)chunks
- the chunk list
-
toJson
String toJson() -
parseFieldName
static void parseFieldName(com.fasterxml.jackson.core.JsonParser parser, DataChunk.JsonParsingContext context) throws IOException - Throws:
IOException
-
addUncompressedChunk
-
addCompressedChunk
-
parseEndObject
-
parseValueNumberInt
static void parseValueNumberInt(com.fasterxml.jackson.core.JsonParser parser, DataChunk.JsonParsingContext context) throws IOException - Throws:
IOException
-
parseJson
static void parseJson(com.fasterxml.jackson.core.JsonParser parser, List<DoubleDataChunk> doubleChunks, List<StringDataChunk> stringChunks) -
parseJson
static void parseJson(com.fasterxml.jackson.core.JsonParser parser, List<DoubleDataChunk> doubleChunks, List<StringDataChunk> stringChunks, boolean single)
-