com.miginfocom.ashape.animation.animations
Class NumberAnimation

java.lang.Object
  extended by com.miginfocom.ashape.animation.animations.AbstractAnimation
      extended by com.miginfocom.ashape.animation.animations.NumberAnimation
All Implemented Interfaces:
Animation, java.io.Serializable

public class NumberAnimation
extends AbstractAnimation

Animates over a subclass of Number.

See Also:
Serialized Form

Constructor Summary
NumberAnimation(java.lang.Number sNum, java.lang.Number eNum)
          Constructor for no precalculated values.
NumberAnimation(java.lang.Number sNum, java.lang.Number eNum, int cacheFrameCount)
          Constructor.
 
Method Summary
protected  void assertCompatible(java.lang.Number sNum, java.lang.Number eNum)
          Throws a IllegalArgumentException if the values aren't of same class type
protected  java.lang.Object createObject(float perc)
          Returns a newly created object that complies to the same rules as AbstractAnimation.getObject(float).
 boolean equals(java.lang.Object o)
           
 java.lang.Number getEndValue()
          Returns value 2.
 java.lang.Number getStartValue()
          Returns value 1.
 
Methods inherited from class com.miginfocom.ashape.animation.animations.AbstractAnimation
createCache, createCacheImpl, getFrameCount, getObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberAnimation

public NumberAnimation(java.lang.Number sNum,
                       java.lang.Number eNum)
Constructor for no precalculated values. n1 and n2 needs to be of same type.

Currently handles: Integer, Long, Float and Double.

Parameters:
sNum - The first value. Not null.
eNum - The second value. Not null.
See Also:
AbstractAnimation

NumberAnimation

public NumberAnimation(java.lang.Number sNum,
                       java.lang.Number eNum,
                       int cacheFrameCount)
Constructor. n1 and n2 needs to be of same type.

Currently handles: Integer, Long, Float and Double.

Parameters:
sNum - The first value. Not null.
eNum - The second value. Not null.
cacheFrameCount - The number of cached values. Use to create a "set" of values so that the AbstractAnimation.getObject(float) won't have to make new once for every call.
See Also:
AbstractAnimation
Method Detail

createObject

protected java.lang.Object createObject(float perc)
Description copied from class: AbstractAnimation
Returns a newly created object that complies to the same rules as AbstractAnimation.getObject(float). For subclasses to implement.

Specified by:
createObject in class AbstractAnimation
Parameters:
perc - 0.0 to 1.0 0.0 is the first Object/frame and 1.0 is the last.
Returns:
A newly created object that complies to the same rules as AbstractAnimation.getObject(float).

assertCompatible

protected void assertCompatible(java.lang.Number sNum,
                                java.lang.Number eNum)
Throws a IllegalArgumentException if the values aren't of same class type

Parameters:
sNum - The start value
eNum - The end value

getStartValue

public java.lang.Number getStartValue()
Returns value 1.

Returns:
The first value.

getEndValue

public java.lang.Number getEndValue()
Returns value 2.

Returns:
The second value.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class AbstractAnimation


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.