public class DataArray extends LinePars implements Serializable
A data array has plotting attributes, e.g. saying whether we should plot symbols, draw lines or fill areas. All the plotting attributes are defined in the base-class LinePars, here we set the actual data array, i.e. a vector of points (PlotPoints) defining X,Y.
LinePars
,
Serialized FormConstructor and Description |
---|
DataArray()
Default constructor, initializes the class with nothing.
|
DataArray(int file,
int col)
Initializes the class with a file- and column index.
|
DataArray(int file,
int col,
int n)
Initializes the class with a file- and column index and allocates memory
for the data points.
|
DataArray(int file,
int col,
int n,
LinePars lp)
Initializes the class with a file- and column index and allocates memory
for the data points.
|
DataArray(int file,
LinePars lp)
Initializes the class with a file- and column index and allocates memory
for the data points.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(double x,
double y)
Adds the values of a plot-point pair (x,y).
|
void |
addPoint(double x,
double y,
boolean liftPen)
Adds the values of a plot-point pair (x,y).
|
void |
addPoint(double x,
double y,
double upper,
double lower)
Adds the values of a plot-point pair (x,y).
|
void |
addPoint(double x,
double y,
double left,
double right,
double upper,
double lower)
Adds the values of a plot-point pair (x,y).
|
void |
addPoint(double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
Adds the values of a plot-point pair (x,y).
|
void |
allocate(int n)
Allocation of memory for the data points.
|
void |
allUpdate()
update all min and max.
|
void |
clear()
Clears the current array.
|
int |
getColumnIndex()
Returns the column index of this data array.
|
Vector |
getData()
Return the data vector
|
int |
getDimension()
Return the dimension of this data
|
int |
getFileIndex()
Returns the file index of this data array.
|
LinePars |
getLinePars()
Get the drawing style parameters at once.
|
double |
getLowestNonZeroValue(int axis)
Returns the lowest, but non-zero value in the range.
|
double |
getMaxValue(int axis)
Returns the maximum value in the range.
|
double |
getMinValue(int axis)
Returns the minimum value in the range.
|
PlotPoint |
getPoint(int i)
Returns the plot-point of the specified index.
|
BasicStroke |
getStroke()
Returns the stroke used to plot these points.
|
String |
getTitle()
Get the title if any
|
double |
getX(int i)
Return a specific X-value.
|
double |
getXleft(int i)
Return a specific left error on X-value.
|
double |
getXleftSys(int i)
Return a specific left error on X-value (systematical error).
|
double |
getXright(int i)
Return a specific right error on X-value.
|
double |
getXrightSys(int i)
Return a specific right error on X-value (systematical error).
|
double |
getY(int i)
Return a specific Y-value.
|
double |
getYlower(int i)
Return a specific lower error on Y-value.
|
double |
getYlowerSys(int i)
Return a specific total lower error on Y-value.
|
double |
getYupper(int i)
Return a specific upper error on Y-value.
|
double |
getYupperSys(int i)
Return a specific systematical upper error on Y-value.
|
boolean |
liftPen(int i) |
double |
mean() |
boolean |
parse(BufferedReader in)
Read DataArray from BufferedReader
|
boolean |
parse(File file)
Get data from a file
|
void |
print()
Convert to string
|
void |
replacePoint(int i,
double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
Replace the values of a plot-point pair (x,y).
|
void |
setDimension(int dimension)
Set the dimension of this data
|
void |
setLiftPen(int i)
Defines that, for this plotpoint, the pen should lift.
|
void |
setLinePars(LinePars l)
Sets the drawing style parameters at once.
|
void |
setPoint(int i,
double x,
double y)
Sets the values of a plot-point pair (x,y).
|
void |
setPoint(int i,
double x,
double y,
double upper,
double lower)
Sets the values of a plot-point pair (x,y).
|
void |
setPoint(int i,
double x,
double y,
double left,
double right,
double upper,
double lower)
Sets the values of a plot-point pair (x,y).
|
void |
setPoint(int i,
double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
Sets the values of a plot-point pair (x,y).
|
int |
size()
Return the length of the data vector.
|
void |
sort(boolean ascending)
Sorts the arrays in ascending or descending order.
|
void |
toFile(String name,
String title)
Write a DataArray to an external file.
|
String |
toString()
Print a data container on the screen
|
void |
updateMean(double x,
double y)
Updates Mean values.
|
void |
updateMinMax(double x,
double y)
Updates maximum and minimum values.
|
void |
updateMinMax(double x,
double y,
double left,
double right,
double upper,
double lower)
Updates maximum and minimum values.
|
void |
updateMinMax(double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
Updates maximum and minimum values.
|
copy, dataChanged, drawLegend, drawLine, drawSymbol, errorsFill, errorsFillSys, errorsSysX, errorsSysY, errorsX, errorsY, fill, fill, getAdditioner, getAttributes, getColor, getColorErrorsFill, getColorErrorsFillSys, getColorErrorsSysX, getColorErrorsSysY, getColorErrorsX, getColorErrorsY, getColorIndex, getDashIndex, getDashLength, getEndColor, getErrorFillColorTransp, getErrorFillColorTranspSys, getErrorsFill, getErrorsFillSys, getErrorsSysX, getErrorsSysY, getErrorsX, getErrorsY, getErrTicSize, getFillColor, getFillColorTransparency, getGraphStyle, getMultiplier, getName, getNameX, getNameY, getNameZ, getPenWidth, getPenWidthErr, getPenWidthErrSys, getPointFrequency, getSettings, getStartColor, getSymbol, getSymbolSize, getType, getWidthBin, isBarShown, isDrawLine, isDrawSymbol, nextColor, print, setAdditioner, setColor, setColor, setColorErrorsFill, setColorErrorsFillSys, setColorErrorsSysX, setColorErrorsSysY, setColorErrorsX, setColorErrorsY, setDashLength, setDashLength, setDataChanged, setDrawLegend, setDrawLine, setDrawSymbol, setErrorFillColorTransp, setErrorFillColorTranspSys, setErrTicSize, setFillColor, setFillColorTransparency, setGraphStyle, setMultiplier, setName, setNameX, setNameY, setNameZ, setPenWidth, setPenWidthErr, setPenWidthErrSys, setPointFrequency, setShowBars, setSlideColor, setSlideColor, setSymbol, setSymbolSize, setType, setWidthBin, slideColor, updateSettings
public DataArray()
public DataArray(int file, int col)
file
- index of the filecol
- index of the columnpublic DataArray(int file, int col, int n)
file
- index of the filecol
- index of the columnn
- buffer, maximum number of datapoints.public DataArray(int file, int col, int n, LinePars lp)
file
- index of the filecol
- index of the columnn
- buffer, maximum number of datapoints.lp
- line parameters class, contains info of how to draw the line.public DataArray(int file, LinePars lp)
file
- index of the filecol
- index of the columnn
- buffer, maximum number of datapoints.lp
- line parameters class, contains info of how to draw the line.public void allocate(int n)
n
- maximum number of datapoints.public void updateMinMax(double x, double y)
x
- just entered x-value of the pointy
- just entered y-value of the pointpublic void updateMinMax(double x, double y, double left, double right, double upper, double lower)
x
- just entered x-value of the pointy
- just entered y-value of the pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)public void updateMinMax(double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
x
- just entered x-value of the pointy
- just entered y-value of the pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void updateMean(double x, double y)
x
- just entered x-value of the pointy
- just entered y-value of the pointpublic double mean()
public void addPoint(double x, double y)
x
- x-value of the plot-pointy
- y-value of the plot-pointpublic void addPoint(double x, double y, double upper, double lower)
x
- x-value of the plot-pointy
- y-value of the plot-pointupper
- - error on y (upper)lower
- - error on y (lower)public void addPoint(double x, double y, double left, double right, double upper, double lower)
x
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)public void addPoint(double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
x
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void addPoint(double x, double y, boolean liftPen)
x
- x-value of the plot-pointy
- y-value of the plot-pointliftPen
- true if the pen should lift after this pointpublic void setPoint(int i, double x, double y)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointpublic void setPoint(int i, double x, double y, double upper, double lower)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointupper
- upper error on ylower
- lower error on ypublic void setPoint(int i, double x, double y, double left, double right, double upper, double lower)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)public void setPoint(int i, double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void replacePoint(int i, double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void allUpdate()
public PlotPoint getPoint(int i)
i
- index of the plot-pointpublic void setLiftPen(int i)
i
- index of the plot-pointpublic boolean liftPen(int i)
public int size()
public int getDimension()
public void setDimension(int dimension)
dimension
- public Vector getData()
public double getX(int i)
i
- index of the arraypublic double getXleft(int i)
i
- index of the arraypublic double getXright(int i)
i
- index of the arraypublic double getXleftSys(int i)
i
- index of the arraypublic double getXrightSys(int i)
i
- index of the arraypublic double getY(int i)
i
- index of the arraypublic double getYupper(int i)
i
- index of the arraypublic double getYlower(int i)
i
- index of the arraypublic double getYupperSys(int i)
i
- index of the arraypublic double getYlowerSys(int i)
i
- index of the arraypublic double getMaxValue(int axis)
axis
- defines to which axis this function applies.public double getMinValue(int axis)
axis
- defines to which axis this function applies.public double getLowestNonZeroValue(int axis)
axis
- defines to which axis this function applies.public BasicStroke getStroke()
public void setLinePars(LinePars l)
l
- line and point drawing parameters.public LinePars getLinePars()
public int getFileIndex()
public int getColumnIndex()
public void clear()
public void sort(boolean ascending)
ascending
- true if we should sort from small to largepublic void toFile(String name, String title)
name
- File name with outputtitle
- Titlepublic String getTitle()
public boolean parse(File file)
file
- public boolean parse(BufferedReader in)
in
- BufferedReaderJas4pp 1.5 © Java Analysis Studio for Particle Physics