public class LimitType
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected double |
_max |
protected double |
_min |
Constructor and Description |
---|
LimitType()
Default constructor.
|
LimitType(double max,
double min)
Constructor.
|
LimitType(LimitType lim)
Copy constructor.
|
LimitType(java.lang.String str)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getMax()
Get the max limit.
|
double |
getMiddle()
Get the middle value.
|
double |
getMin()
Get the min limit.
|
boolean |
isError()
Check if the Limit data is in error status.
|
boolean |
isViolated(double x)
Check if there is a limit violation, max > x > min.
|
boolean |
isViolated(double x,
double tolerance)
Check if there is a limit violation, max > x > min with the tolerance.
|
boolean |
isZero()
check if the limit is zero
|
double |
limit(double x)
Perform limit action.
|
double |
limitDiscrete(double x,
double stepSize)
Perform discrete limit action.
|
double |
mismatch(double x)
calculate limit mismatch
if (x > getMax()) {
return x - getMax();
} else if (x < getMin()) {
return x - getMin();
} else {
return 0;
}
|
java.lang.String |
toString()
Convert the obj to a string.
|
java.lang.String |
toString(double actual)
Convert the obj to a string with an actual number as an input
|
public LimitType()
public LimitType(double max, double min)
max
- unper limitmin
- lower limitpublic LimitType(java.lang.String str) throws IpssNumericException
max
- unper limitmin
- lower limitIpssNumericException
public LimitType(LimitType lim)
lim
- limit obj to be copiedpublic boolean isError()
public boolean isZero()
public double getMiddle()
public double getMax()
public double getMin()
public boolean isViolated(double x)
x
- a double number to be checkedpublic boolean isViolated(double x, double tolerance)
x
- a double number to be checkedtolerance
- public double limit(double x)
public double mismatch(double x)
public double limitDiscrete(double x, double stepSize) throws IpssNumericException
IpssNumericException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(double actual)