pmlib
Class PMLCurve

java.lang.Object
  extended by pmlib.PMLCurve

public class PMLCurve
extends java.lang.Object

PMLCurve Class

The PMLCurve object allows the creation of value curves. The object iterates between initial and target values over the specified time period.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.


Constructor Summary
PMLCurve(float v)
          Create an object instance with the specified initial value
 
Method Summary
 float deltaFloatValue()
          Return the difference between the current and last requested object values
 int deltaIntValue()
          Return the difference between the current and last requested object values
 float floatValue()
          Return the current object value
 boolean hasChanged()
          Return true if the value of this object has changed due to a call to set() or internal ramping
 int intValue()
          Return the current object value as a rounded integer
 boolean isActive()
          Return the activity state of the object
 void set(float v)
          Set the object value to that specified
 void set(float i, float v, int t)
          Create a curve with the specified initial and target values, and iteration time
 void set(float i, float v, int t, float e)
          Create a curve with the specified initial and target values, iteration time and curve exponent
 void set(float v, int t)
          Create a curve with the specified target value and iteration time
 void set(float v, int t, float e)
          Create a curve with the specified target value, iteration time and curve exponent
 java.lang.String toString()
          Return the value of this object as a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PMLCurve

public PMLCurve(float v)
Create an object instance with the specified initial value

Parameters:
v - initial value
Method Detail

floatValue

public float floatValue()
Return the current object value

Returns:
the current object value

intValue

public int intValue()
Return the current object value as a rounded integer

Returns:
the current object value as a rounded integer

deltaFloatValue

public float deltaFloatValue()
Return the difference between the current and last requested object values

Returns:
the difference between the current and last requested object values

deltaIntValue

public int deltaIntValue()
Return the difference between the current and last requested object values

Returns:
the difference between the current and last requested object values

set

public void set(float v)
Set the object value to that specified

Parameters:
v - value

set

public void set(float v,
                int t)
Create a curve with the specified target value and iteration time

Parameters:
v - target value
t - iteration time

set

public void set(float v,
                int t,
                float e)
Create a curve with the specified target value, iteration time and curve exponent

Parameters:
v - target value
t - iteration time
e - curve exponent

set

public void set(float i,
                float v,
                int t)
Create a curve with the specified initial and target values, and iteration time

Parameters:
i - initial value
v - target value
t - iteration time

set

public void set(float i,
                float v,
                int t,
                float e)
Create a curve with the specified initial and target values, iteration time and curve exponent

Parameters:
i - initial value
v - target value
t - iteration time
e - curve exponent

isActive

public boolean isActive()
Return the activity state of the object

Returns:
the activity state of the object

hasChanged

public boolean hasChanged()
Return true if the value of this object has changed due to a call to set() or internal ramping

The value of this object is deemed to have changed if the difference between current and previous values is less than 1*10^-10.

Returns:
true if the value of this object has changed

toString

public java.lang.String toString()
Return the value of this object as a String

Overrides:
toString in class java.lang.Object
Returns:
the value of this object as a String