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
|
private long |
heightInPixel
the plot area height in pixels
|
private boolean |
isXLogScale
the state indicating if x axis is log scale
|
private boolean |
isYLogScale
the state indicating if y axis is log scale
|
protected CompressConfig |
prevConfig
the previous configuration for compressor
|
protected int |
previousXGridIndex
the previous X grid index
|
protected int |
previousYGridIndex
the previous Y grid index
|
private long |
widthInPixel
the plot area width in pixels
|
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
private boolean isXLogScale
private boolean isYLogScale
private long widthInPixel
private long heightInPixel
public void setXSeries(double[] xSeries)
ICompress
setXSeries
in interface ICompress
xSeries
- the X seriespublic void setYSeries(double[] ySeries)
ICompress
setYSeries
in interface ICompress
ySeries
- the Y seriespublic double[] getCompressedXSeries()
ICompress
getCompressedXSeries
in interface ICompress
public double[] getCompressedYSeries()
ICompress
getCompressedYSeries
in interface ICompress
public int[] getCompressedIndexes()
ICompress
getCompressedIndexes
in interface ICompress
public final boolean compress(CompressConfig compressConfig)
ICompress
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)
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