|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectstella.util.SchmidtTrigger
public class SchmidtTrigger
A Schmidt trigger. The Schmidt trigger needs two values, the on and off
value. The history of the toggle state is taken into account in a very basic
way: If the current toggle state is true, the new value added needs to fall
below the off value to change the toggle state to false. On the
other side, if the toggle state is at false, the new value added must
be at least above the on value to toggle.
| Field Summary | |
|---|---|
private boolean |
current
The current state of the toggle trigger. |
private double |
off
The value that must be undercut to turn the toggle from true to false. |
private double |
on
The value that must be exceeded to turn the toggle from false to true. |
| Constructor Summary | |
|---|---|
protected |
SchmidtTrigger()
Common constructor. |
|
SchmidtTrigger(double offtrig,
double ontrig)
Constructs a new Schmidt trigger. |
|
SchmidtTrigger(String parameter)
Constructs a new Schmidt trigger. |
| Method Summary | |
|---|---|
boolean |
addHit(double val)
Return true, if the argument value is above the appropriate trigger. |
protected void |
setTriggers(double offtrig,
double ontrig)
Sets the two trigger values. |
String |
toString()
Returns the two toggle edges as a description. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private boolean current
private double on
private double off
| Constructor Detail |
|---|
protected SchmidtTrigger()
public SchmidtTrigger(String parameter)
off
and on must be separated with a comma.
public SchmidtTrigger(double offtrig,
double ontrig)
off trigger must be less than the second argument, the
on trigger.
| Method Detail |
|---|
protected void setTriggers(double offtrig,
double ontrig)
public boolean addHit(double val)
on value is used, the off value otherwise.
addHit in interface Togglingpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||