Package com.powsybl.timeseries
Class UncompressedStringDataChunk
- java.lang.Object
-
- com.powsybl.timeseries.AbstractUncompressedDataChunk
-
- com.powsybl.timeseries.UncompressedStringDataChunk
-
- All Implemented Interfaces:
DataChunk<StringPoint,StringDataChunk>
,StringDataChunk
public class UncompressedStringDataChunk extends AbstractUncompressedDataChunk implements StringDataChunk
- 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 UncompressedStringDataChunk(int offset, String[] values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringDataChunk
append(StringDataChunk otherChunk)
Append the chunk with the one given in argument, and return the result.boolean
equals(Object obj)
void
fillBuffer(BigStringBuffer buffer, long timeSeriesOffset)
void
fillBuffer(CompactStringBuffer buffer, int timeSeriesOffset)
TimeSeriesDataType
getDataType()
Get data type.int
getEstimatedSize()
Get estimated size in bytes.int
getLength()
Get data chunk lengthString[]
getValues()
int
hashCode()
Iterator<StringPoint>
iterator(TimeSeriesIndex index)
Get a point iterator.DataChunk.Split<StringPoint,StringDataChunk>
splitAt(int splitIndex)
Split the chunk in two parts.Stream<StringPoint>
stream(TimeSeriesIndex index)
Get a point stream.StringDataChunk
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
-
-
-
-
Constructor Detail
-
UncompressedStringDataChunk
public UncompressedStringDataChunk(int offset, String[] values)
-
-
Method Detail
-
getValues
public String[] getValues()
-
getLength
public int getLength()
Description copied from interface:DataChunk
Get data chunk length- Specified by:
getLength
in interfaceDataChunk<StringPoint,StringDataChunk>
- Returns:
- data chunk length
-
getEstimatedSize
public int getEstimatedSize()
Description copied from interface:DataChunk
Get estimated size in bytes.- Specified by:
getEstimatedSize
in interfaceDataChunk<StringPoint,StringDataChunk>
- Returns:
- estimated size in bytes
-
getDataType
public TimeSeriesDataType getDataType()
Description copied from interface:DataChunk
Get data type.- Specified by:
getDataType
in interfaceDataChunk<StringPoint,StringDataChunk>
- Returns:
- the data type
-
fillBuffer
public void fillBuffer(CompactStringBuffer buffer, int timeSeriesOffset)
- Specified by:
fillBuffer
in interfaceStringDataChunk
-
fillBuffer
public void fillBuffer(BigStringBuffer buffer, long timeSeriesOffset)
- Specified by:
fillBuffer
in interfaceStringDataChunk
-
tryToCompress
public StringDataChunk tryToCompress()
Description copied from interface:DataChunk
Try to compress the chunk.- Specified by:
tryToCompress
in interfaceDataChunk<StringPoint,StringDataChunk>
- Returns:
- the compressed chunk or itself if compression is not efficient enough
-
splitAt
public DataChunk.Split<StringPoint,StringDataChunk> splitAt(int splitIndex)
Description copied from interface:DataChunk
Split the chunk in two parts.- Specified by:
splitAt
in interfaceDataChunk<StringPoint,StringDataChunk>
- Parameters:
splitIndex
- the split index- Returns:
- both chunks
-
append
public StringDataChunk append(StringDataChunk 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<StringPoint,StringDataChunk>
- Parameters:
otherChunk
- : the chunk to append with this object. It has to be the same implementation as this object.- Returns:
-
stream
public Stream<StringPoint> stream(TimeSeriesIndex index)
Description copied from interface:DataChunk
Get a point stream.- Specified by:
stream
in interfaceDataChunk<StringPoint,StringDataChunk>
- Parameters:
index
- the time series index- Returns:
- a point stream
-
iterator
public Iterator<StringPoint> iterator(TimeSeriesIndex index)
Description copied from interface:DataChunk
Get a point iterator.- Specified by:
iterator
in interfaceDataChunk<StringPoint,StringDataChunk>
- 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
-
-