public class Scaler extends java.lang.Object implements ChangeListener, XMLPersistent
Modifier and Type | Field and Description |
---|---|
double[] |
scaleLK |
Constructor and Description |
---|
Scaler(double leftIn,
double rightIn,
double leftOut,
double rightOut,
boolean integerData) |
Scaler(double leftIn,
double rightIn,
double leftOut,
double rightOut,
boolean integerData,
boolean canCross) |
Scaler(double absLeftIn,
double absRightIn,
double leftIn,
double rightIn,
double leftOut,
double rightOut,
boolean integerData,
boolean canCross) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ScalerListener listener)
Add a listener
|
void |
beginUpdate() |
static boolean |
contains(Scaler[] scalers,
Scaler scaler) |
void |
endUpdate() |
void |
fireEvent(ScalerEvent e)
fire event
|
double |
getAbsLeftIn() |
double |
getAbsRightIn() |
boolean |
getCanCross() |
double |
getLeftIn() |
double |
getLeftOut() |
double |
getRightIn() |
double |
getRightOut() |
double |
getScaler()
Return the scaler value
|
static int |
indexOf(Scaler[] scalers,
Scaler scaler) |
boolean |
isCrossed() |
boolean |
isIntegerData() |
boolean |
isNull()
Return true if scaler doesn't change value (input = output)
|
boolean |
isUpdating() |
boolean |
loadFromXML(org.w3c.dom.Node node)
LOAD
|
void |
onChanged(CollapsibleEvent compare)
fire changed event
|
void |
removeListener(ScalerListener listener)
Remove a listener
|
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
void |
scale(byte[] src,
double[] dest,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(byte[] src,
int[] dest,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(byte[] src,
int srcOffset,
double[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(byte[] src,
int srcOffset,
int[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
double |
scale(double value)
Scale the value
|
void |
scale(double[] data)
Scale array
|
void |
scale(double[] src,
double[] dest)
Scale array
|
void |
scale(double[] src,
int[] dest)
Scale array
|
void |
scale(double[] src,
int srcOffset,
double[] dest,
int destOffset,
int len)
Scale array
|
void |
scale(double[] data,
int offset,
int len)
Scale array
|
void |
scale(double[] src,
int srcOffset,
int[] dest,
int destOffset,
int len)
Scale array
|
void |
scale(float[] data)
Scale array
|
void |
scale(float[] src,
double[] dest)
Scale array
|
void |
scale(float[] src,
int[] dest)
Scale array
|
void |
scale(float[] src,
int srcOffset,
double[] dest,
int destOffset,
int len)
Scale array
|
void |
scale(float[] data,
int offset,
int len)
Scale array
|
void |
scale(float[] src,
int srcOffset,
int[] dest,
int destOffset,
int len)
Scale array
|
void |
scale(int[] src,
double[] dest,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(int[] src,
int[] dest,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(int[] src,
int srcOffset,
double[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(int[] src,
int srcOffset,
int[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(long[] src,
int srcOffset,
double[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(long[] src,
int srcOffset,
int[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(java.lang.Object src,
int[] dest,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(java.lang.Object src,
int srcOffset,
int[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(short[] src,
double[] dest,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(short[] src,
int[] dest,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(short[] src,
int srcOffset,
double[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
scale(short[] src,
int srcOffset,
int[] dest,
int destOffset,
int len,
boolean signed)
Scale each value in the "src" array and return result in "dest" array
|
void |
setAbsLeftIn(double absLeftIn) |
void |
setAbsLeftRightIn(double left,
double right) |
void |
setAbsRightIn(double absRightIn) |
void |
setCanCross(boolean canCross) |
void |
setLeftIn(double leftIn) |
void |
setLeftOut(double leftOut) |
void |
setLeftRightIn(double left,
double right) |
void |
setLeftRightOut(double left,
double right) |
void |
setRightIn(double rightIn) |
void |
setRightOut(double rightOut) |
double |
unscale(double value)
Scale the value
|
public double[] scaleLK
public Scaler(double leftIn, double rightIn, double leftOut, double rightOut, boolean integerData)
public Scaler(double leftIn, double rightIn, double leftOut, double rightOut, boolean integerData, boolean canCross)
public Scaler(double absLeftIn, double absRightIn, double leftIn, double rightIn, double leftOut, double rightOut, boolean integerData, boolean canCross)
public double scale(double value)
value
- value to scalepublic double unscale(double value)
value
- value to scalepublic void scale(java.lang.Object src, int srcOffset, int[] dest, int destOffset, int len, boolean signed)
src
- array of byte (unscaled values)srcOffset
- offset for src bufferdest
- result as array of int (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(byte[] src, int srcOffset, int[] dest, int destOffset, int len, boolean signed)
src
- array of byte (unscaled values)srcOffset
- offset for src bufferdest
- result as array of int (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(short[] src, int srcOffset, int[] dest, int destOffset, int len, boolean signed)
src
- array of short (unscaled values)srcOffset
- offset for src bufferdest
- result as array of int (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(int[] src, int srcOffset, int[] dest, int destOffset, int len, boolean signed)
src
- array of int (unscaled values)srcOffset
- offset for src bufferdest
- result as array of int (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(long[] src, int srcOffset, int[] dest, int destOffset, int len, boolean signed)
src
- array of long (unscaled values)srcOffset
- offset for src bufferdest
- result as array of int (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(float[] src, int srcOffset, int[] dest, int destOffset, int len)
src
- array of float (unscaled values)srcOffset
- offset for src bufferdest
- result as array of int (scaled values)destOffset
- offset for dest bufferlen
- length to computepublic void scale(double[] src, int srcOffset, int[] dest, int destOffset, int len)
src
- array of double (unscaled values)srcOffset
- offset for src bufferdest
- result as array of int (scaled values)destOffset
- offset for dest bufferlen
- length to computepublic void scale(byte[] src, int srcOffset, double[] dest, int destOffset, int len, boolean signed)
src
- array of byte (unscaled values)srcOffset
- offset for src bufferdest
- result as array of double (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(short[] src, int srcOffset, double[] dest, int destOffset, int len, boolean signed)
src
- array of short (unscaled values)srcOffset
- offset for src bufferdest
- result as array of double (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(int[] src, int srcOffset, double[] dest, int destOffset, int len, boolean signed)
src
- array of int (unscaled values)srcOffset
- offset for src bufferdest
- result as array of double (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(long[] src, int srcOffset, double[] dest, int destOffset, int len, boolean signed)
src
- array of long (unscaled values)srcOffset
- offset for src bufferdest
- result as array of double (scaled values)destOffset
- offset for dest bufferlen
- length to computesigned
- signed/unsigned src data flagpublic void scale(float[] src, int srcOffset, double[] dest, int destOffset, int len)
src
- array of float (unscaled values)srcOffset
- offset for src bufferdest
- result as array of double (scaled values)destOffset
- offset for dest bufferlen
- length to computepublic void scale(double[] src, int srcOffset, double[] dest, int destOffset, int len)
src
- array of double (unscaled values)srcOffset
- offset for src bufferdest
- result as array of double (scaled values)destOffset
- offset for dest bufferlen
- length to computepublic void scale(float[] data, int offset, int len)
data
- array of float value to scaleoffset
- offset for bufferlen
- length to computepublic void scale(double[] data, int offset, int len)
data
- array of double value to scaleoffset
- offset for bufferlen
- length to computepublic void scale(java.lang.Object src, int[] dest, boolean signed)
src
- array of byte (unscaled values)dest
- result as array of int (scaled values)signed
- signed/unsigned src data flagpublic void scale(byte[] src, int[] dest, boolean signed)
src
- array of byte (unscaled values)dest
- result as array of int (scaled values)signed
- signed/unsigned src data flagpublic void scale(short[] src, int[] dest, boolean signed)
src
- array of short (unscaled values)dest
- result as array of int (scaled values)signed
- signed/unsigned src data flagpublic void scale(int[] src, int[] dest, boolean signed)
src
- array of int (unscaled values)dest
- result as array of int (scaled values)signed
- signed/unsigned src data flagpublic void scale(float[] src, int[] dest)
src
- array of float (unscaled values)dest
- result as array of int (scaled values)public void scale(double[] src, int[] dest)
src
- array of double (unscaled values)dest
- result as array of int (scaled values)public void scale(byte[] src, double[] dest, boolean signed)
src
- array of byte (unscaled values)dest
- result as array of double (scaled values)signed
- signed/unsigned src data flagpublic void scale(short[] src, double[] dest, boolean signed)
src
- array of short (unscaled values)dest
- result as array of double (scaled values)signed
- signed/unsigned src data flagpublic void scale(int[] src, double[] dest, boolean signed)
src
- array of int (unscaled values)dest
- result as array of double (scaled values)signed
- signed/unsigned src data flagpublic void scale(float[] src, double[] dest)
src
- array of float (unscaled values)dest
- result as array of double (scaled values)public void scale(double[] src, double[] dest)
src
- array of double (unscaled values)dest
- result as array of double (scaled values)public void scale(float[] data)
data
- array of float value to scalepublic void scale(double[] data)
data
- array of double value to scalepublic double getScaler()
public boolean isIntegerData()
public boolean isCrossed()
public boolean isNull()
public boolean getCanCross()
public void setCanCross(boolean canCross)
canCross
- the canCross to setpublic double getAbsLeftIn()
public void setAbsLeftIn(double absLeftIn)
absLeftIn
- the absLeftIn to setpublic double getAbsRightIn()
public void setAbsRightIn(double absRightIn)
absRightIn
- the absRightIn to setpublic double getLeftIn()
public void setLeftIn(double leftIn)
leftIn
- the leftIn to setpublic double getRightIn()
public void setRightIn(double rightIn)
rightIn
- the rightIn to setpublic double getLeftOut()
public void setLeftOut(double leftOut)
leftOut
- the leftOut to setpublic double getRightOut()
public void setRightOut(double rightOut)
rightOut
- the rightOut to setpublic void setAbsLeftRightIn(double left, double right)
left
- the leftAbsIn to setright
- the rightAbsIn to setpublic void setLeftRightIn(double left, double right)
left
- the leftIn to setright
- the rightIn to setpublic void setLeftRightOut(double left, double right)
left
- the leftOut to setright
- the rightOut to setpublic void fireEvent(ScalerEvent e)
public void addListener(ScalerListener listener)
listener
- public void removeListener(ScalerListener listener)
listener
- public void onChanged(CollapsibleEvent compare)
ChangeListener
onChanged
in interface ChangeListener
public void beginUpdate()
public void endUpdate()
public boolean isUpdating()
public boolean loadFromXML(org.w3c.dom.Node node)
XMLPersistent
loadFromXML
in interface XMLPersistent
public boolean saveToXML(org.w3c.dom.Node node)
XMLPersistent
saveToXML
in interface XMLPersistent