public abstract class Compress extends java.lang.Object implements ICompress
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
compressed
the flag indicating whether the data is compressed
|
protected int[] |
compressedIndexes
the compressed series indexes
|
protected double[] |
compressedXSeries
the compressed X series
|
protected double[] |
compressedYSeries
the compressed Y series
|
protected CompressConfig |
config
the configuration for compressor
|
protected CompressConfig |
prevConfig
the previous configuration for compressor
|
protected int |
previousXGridIndex
the previous X grid index
|
protected int |
previousYGridIndex
the previous Y grid index
|
protected double |
xLower
the lower value of x range
|
protected double[] |
xSeries
the source X series to be compressed
|
protected double |
xUpper
the upper value of x range
|
protected double |
yLower
the lower value of y range
|
protected double[] |
ySeries
the source Y series to be compressed
|
protected double |
yUpper
the upper value of y range
|
| Constructor and Description |
|---|
Compress() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addNecessaryPlots(java.util.ArrayList<java.lang.Double> xList,
java.util.ArrayList<java.lang.Double> yList,
java.util.ArrayList<java.lang.Integer> indexList)
Adds the necessary plots.
|
protected void |
addToList(java.util.ArrayList<java.lang.Double> xList,
java.util.ArrayList<java.lang.Double> yList,
java.util.ArrayList<java.lang.Integer> indexList,
double x,
double y,
int index)
Adds the given coordinate to list.
|
boolean |
compress(CompressConfig compressConfig)
Ignores the points which are in the same grid as the previous point.
|
int[] |
getCompressedIndexes()
Gets the compressed series indexes
|
double[] |
getCompressedXSeries()
Gets the compressed X series
|
double[] |
getCompressedYSeries()
Gets the compressed Y series
|
protected boolean |
isInSameGridAsPrevious(double x,
double y)
Checks if the given coordinate is in the same grid as previous.
|
void |
setXSeries(double[] xSeries)
Sets X series which have to be sorted.
|
void |
setYSeries(double[] ySeries)
sets the Y series
|
protected int previousXGridIndex
protected int previousYGridIndex
protected CompressConfig config
protected CompressConfig prevConfig
protected boolean compressed
protected double[] xSeries
protected double[] ySeries
protected transient double[] compressedXSeries
protected transient double[] compressedYSeries
protected transient int[] compressedIndexes
protected double xLower
protected double xUpper
protected double yLower
protected double yUpper
public void setXSeries(double[] xSeries)
ICompresssetXSeries in interface ICompressxSeries - the X seriespublic void setYSeries(double[] ySeries)
ICompresssetYSeries in interface ICompressySeries - the Y seriespublic double[] getCompressedXSeries()
ICompressgetCompressedXSeries in interface ICompresspublic double[] getCompressedYSeries()
ICompressgetCompressedYSeries in interface ICompresspublic int[] getCompressedIndexes()
ICompressgetCompressedIndexes in interface ICompresspublic final boolean compress(CompressConfig compressConfig)
ICompressprotected abstract void addNecessaryPlots(java.util.ArrayList<java.lang.Double> xList,
java.util.ArrayList<java.lang.Double> yList,
java.util.ArrayList<java.lang.Integer> indexList)
xList - the array in which x coordinate for necessary plot is storedyList - the array in which y coordinate for necessary plot is storedindexList - the array in which series index for necessary plot is storedprotected void addToList(java.util.ArrayList<java.lang.Double> xList,
java.util.ArrayList<java.lang.Double> yList,
java.util.ArrayList<java.lang.Integer> indexList,
double x,
double y,
int index)
xList - the list to store the X coordinateyList - the list to store the Y coordinateindexList - the list to store the series indexx - the X coordinatey - the Y coordinateindex - the series indexprotected boolean isInSameGridAsPrevious(double x,
double y)
x - the X coordinatey - the Y coordinate