public final class KeyValue
extends java.lang.Object
KeyFrame, which defines a specific point on a timeline,
can hold multiple KeyValues. KeyValue is an immutable class.
A KeyValue is defined by a target, which is an implementation of
WritableValue, an end value and an
Interpolator.
Most interpolators define the interpolation between two KeyFrames.
(The only exception are tangent-interpolators.)
The KeyValue of the second KeyFrame (in forward
direction) specifies the interpolator to be used in the interval.
Tangent-interpolators define the interpolation to the left and to the right of
a KeyFrame (see Interpolator.TANGENT).
By default, Interpolator.LINEAR is used in the interval.
Timeline,
KeyFrame,
Interpolator| Modifier and Type | Class and Description |
|---|---|
static class |
KeyValue.Type
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
| Modifier and Type | Field and Description |
|---|---|
private static Interpolator |
DEFAULT_INTERPOLATOR |
private java.lang.Object |
endValue |
private Interpolator |
interpolator |
private WritableValue<?> |
target |
private KeyValue.Type |
type |
| Constructor and Description |
|---|
KeyValue(WritableValue<T> target,
T endValue)
Creates a
KeyValue that uses Interpolator.LINEAR. |
KeyValue(WritableValue<T> target,
T endValue,
Interpolator interpolator)
Creates a
KeyValue. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
java.lang.Object |
getEndValue()
Returns the end value of this
KeyValue |
Interpolator |
getInterpolator()
Interpolator to be used for calculating the key value along the
particular interval. |
WritableValue<?> |
getTarget()
Returns the target of this
KeyValue |
KeyValue.Type |
getType()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
int |
hashCode()
Returns a hash code for this
KeyValue object. |
java.lang.String |
toString()
Returns a string representation of this
KeyValue object. |
private static final Interpolator DEFAULT_INTERPOLATOR
private final KeyValue.Type type
private final WritableValue<?> target
private final java.lang.Object endValue
private final Interpolator interpolator
public KeyValue(WritableValue<T> target, T endValue, Interpolator interpolator)
KeyValue.target - the targetendValue - the end valueinterpolator - the Interpolatorjava.lang.NullPointerException - if target or interpolator are nullpublic KeyValue(WritableValue<T> target, T endValue)
KeyValue that uses Interpolator.LINEAR.target - the targetendValue - the end valuejava.lang.NullPointerException - if target or interpolator are null@Deprecated public KeyValue.Type getType()
public WritableValue<?> getTarget()
KeyValuepublic java.lang.Object getEndValue()
KeyValuepublic Interpolator getInterpolator()
Interpolator to be used for calculating the key value along the
particular interval. By default, Interpolator.LINEAR is used.public java.lang.String toString()
KeyValue object.toString in class java.lang.ObjectKeyValue object.public int hashCode()
KeyValue object.hashCode in class java.lang.ObjectKeyValue object.public boolean equals(java.lang.Object obj)
KeyValues are considered equal, if their target, endValue, and interpolator are equal.equals in class java.lang.Object