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
javafx.beans.value.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 | Field and Description |
---|---|
private static Interpolator |
DEFAULT_INTERPOLATOR |
private java.lang.Object |
endValue |
private Interpolator |
interpolator |
private <any> |
target |
private KeyValueType |
type |
Constructor and Description |
---|
KeyValue(<any> target,
T endValue)
Creates a
KeyValue that uses Interpolator.LINEAR . |
KeyValue(<any> 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. |
<any> |
getTarget()
Returns the target of this
KeyValue |
(package private) KeyValueType |
getType() |
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 KeyValueType type
private final <any> target
private final java.lang.Object endValue
private final Interpolator interpolator
public KeyValue(<any> target, T endValue, Interpolator interpolator)
KeyValue
.T
- the type of the KeyValue
target
- the targetendValue
- the end valueinterpolator
- the Interpolator
java.lang.NullPointerException
- if target
or interpolator
are null
public KeyValue(<any> target, T endValue)
KeyValue
that uses Interpolator.LINEAR
.T
- the type of the KeyValue
target
- the targetendValue
- the end valuejava.lang.NullPointerException
- if target
or interpolator
are null
KeyValueType getType()
public <any> getTarget()
KeyValue
public java.lang.Object getEndValue()
KeyValue
public 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.Object
public int hashCode()
KeyValue
object.hashCode
in class java.lang.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