public final class KeyValue extends 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
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(Object obj)
Indicates whether some other object is "equal to" this one.
|
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 |
int |
hashCode()
Returns a hash code for this
KeyValue object. |
String |
toString()
Returns a string representation of this
KeyValue object. |
public KeyValue(WritableValue<T> target, T endValue, Interpolator interpolator)
KeyValue
.target
- the targetendValue
- the end valueinterpolator
- the Interpolator
NullPointerException
- if target
or interpolator
are null
public KeyValue(WritableValue<T> target, T endValue)
KeyValue
that uses Interpolator.LINEAR
.target
- the targetendValue
- the end valueNullPointerException
- if target
or interpolator
are null
public WritableValue<?> getTarget()
KeyValue
public 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 String toString()
KeyValue
object.public int hashCode()
KeyValue
object.Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.