uk.org.toot.control
Class IntegerLaw

java.lang.Object
  extended by uk.org.toot.control.AbstractLaw
      extended by uk.org.toot.control.IntegerLaw
All Implemented Interfaces:
ControlLaw

public class IntegerLaw
extends AbstractLaw

A linear control law. Note that int values are always zero based, as required by the UI and persistence. The user values have the range requested by the user


Constructor Summary
IntegerLaw(int min, int max, java.lang.String units)
           
 
Method Summary
 int getResolution()
          We override resolution to force UI to use discrete positions.
 int intValue(float v)
          return the integer value for user value valid integers are 0 ..
 float userValue(int v)
          return the user value for the integer value valid integers are 0 ..
 
Methods inherited from class uk.org.toot.control.AbstractLaw
getMaximum, getMinimum, getUnits
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerLaw

public IntegerLaw(int min,
                  int max,
                  java.lang.String units)
Method Detail

intValue

public int intValue(float v)
Description copied from interface: ControlLaw
return the integer value for user value valid integers are 0 .. resolution-1


userValue

public float userValue(int v)
Description copied from interface: ControlLaw
return the user value for the integer value valid integers are 0 .. resolution-1


getResolution

public int getResolution()
We override resolution to force UI to use discrete positions.

Specified by:
getResolution in interface ControlLaw
Overrides:
getResolution in class AbstractLaw


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.