VaryingValueImpl (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.model.impl

## Class VaryingValueImpl

- java.lang.Object
- - tv.amwa.maj.model.impl.InterchangeObjectImpl
  - - tv.amwa.maj.model.impl.ParameterImpl
    - - tv.amwa.maj.model.impl.VaryingValueImpl

- All Implemented Interfaces:
    Serializable, Cloneable, MediaEntity, MetadataObject, InterchangeObject, Parameter, VaryingValue

      @MediaClass(uuid1=218169601,
                  uuid2=257,
                  uuid3=15872,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="VaryingValue",
                  description="The VaryingValue class specifies a changing data value for an effect control value.",
                  symbol="VaryingValue")
      public class VaryingValueImpl
      extends ParameterImpl
      implements VaryingValue, Serializable, Cloneable

  Implements a changing data value for an effect control value.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VaryingValueImpl()`
    `VaryingValueImpl(ParameterDefinition parameterDefinition, InterpolationDefinition interpolation)` Creates and initializes a new varying value object, which specifies a changing data value for an effect control value.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendControlPoint(ControlPoint controlPoint)` Adds a control point to the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.
    `void` | `clearControlPoints()`
    `VaryingValue` | `clone()` Create a cloned copy of this interchange object.
    `int` | `countControlPoints()` Returns the number of control points in the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.
    `ControlPoint` | `getControlPointAt(int index)` Retrieves the input control point at the given index in the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.
    `List<ControlPoint>` | `getControlPoints()` Returns the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.
    `Object` | `getInterpolatedValue(Rational inputValue)` Returns the interpolated value of the varying value at a given time position, which should be a value between 0 and 1 inclusive.
    `InterpolationDefinition` | `getInterpolationDefinition()` Returns the interpolation property of this varying value, which specifies the kind of interpolation to be used to find the value between control points.
    `static InterpolationDefinition` | `initializeInterpolation()`
    `List<ControlPoint>` | `initializePointList()`
    `void` | `removeControlPointAt(int index)` This function removes the input control point at the given index in the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.
    `void` | `setInterpolationDefinition(InterpolationDefinition interpolation)`

    - ### Methods inherited from class tv.amwa.maj.model.impl.ParameterImpl

      `getComment, getParameterDefinition, getParameterDefinitionReference, getParameterDefinitionReferenceString, getTypeDefinition, initializeParameterDefinitionReference, setParameterDefinition, setParameterDefinitionReference, setParameterDefinitionReferenceFromStream, setParameterDefinitionReferenceString`

    - ### Methods inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `addApplicationPlugin, appendXMLChildren, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getLinkedGenerationIDString, getObjectClass, getPersistentID, getPersistentIndex, hashCode, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setLinkedGenerationIDString, setObjectClass, setPersistentID, setPersistentIndex, toString`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tv.amwa.maj.model.Parameter

      `getParameterDefinition, getParameterDefinitionReference, getTypeDefinition`

    - ### Methods inherited from interface tv.amwa.maj.model.InterchangeObject

      `addApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toString`

    - ### Methods inherited from interface tv.amwa.maj.industry.MediaEntity

      `getPersistentID, setPersistentIndex`

- - ### Constructor Detail

    - #### VaryingValueImpl

          public VaryingValueImpl()

    - #### VaryingValueImpl

          public VaryingValueImpl(ParameterDefinition parameterDefinition,
                                  InterpolationDefinition interpolation)
                           throws NullPointerException

      Creates and initializes a new varying value object, which specifies a changing data value for an effect control value. The value is identified with the given the given `parameter definition`, and requires an `interpolation definition`. Although the list of control points should not be empty, varying values are used to create control point. The process of setting up a varying value is as follows:

      1. Create a varying value with its parameter and interpolation definition.
      2. Use the varying value to create the control points for the varying value.
      3. Add the control points to the varying value list using `#appendControlPoint(ControlPointImpl)`.
      Parameters:
        `parameterDefinition` - Parameter definition for the varying value, which determines the type of the varying value.
        `interpolation` - Specifies the kind of interpolation to be used to find the value between control points.
      Throws:
        `NullPointerException` - One or more of the arguments is `null` and all are required.

  - ### Method Detail

    - #### getControlPoints

          @MediaProperty(uuid1=100729092,
                         uuid2=1542,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="PointList",
                         typeName="ControlPointStrongReferenceVector",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=19970,
                         symbol="PointList")
          public List<ControlPoint> getControlPoints()

      Description copied from interface: `VaryingValue`

      Returns the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.

      Specified by:
        `getControlPoints` in interface `VaryingValue`
      Returns:
        Shallow copy of the sequence of control points of this varying value.
      See Also:
        `TypeDefinitions.ControlPointStrongReferenceVector`

    - #### initializePointList

          public final List<ControlPoint> initializePointList()

    - #### appendControlPoint

          @MediaListAppend(value="PointList")
          public void appendControlPoint(ControlPoint controlPoint)
                                                                      throws NullPointerException,
                                                                             IllegalArgumentException

      Description copied from interface: `VaryingValue`

      Adds a control point to the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined. The point will be sorted by time order, not the order that the points were added in.

      Specified by:
        `appendControlPoint` in interface `VaryingValue`
      Parameters:
        `controlPoint` - Control point to add to the sequence of control points.
      Throws:
        `NullPointerException` - The given control point is `null`.
        `IllegalArgumentException`

    - #### countControlPoints

          @MediaPropertyCount(value="PointList")
          public int countControlPoints()

      Description copied from interface: `VaryingValue`

      Returns the number of control points in the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.

      Specified by:
        `countControlPoints` in interface `VaryingValue`
      Returns:
        Number of control points in the sequence of control points of the varying value.

    - #### clearControlPoints

          @MediaPropertyClear(value="PointList")
          public void clearControlPoints()

    - #### getControlPointAt

          @MediaListGetAt(value="PointList")
          public ControlPoint getControlPointAt(int index)
                                                                            throws IndexOutOfBoundsException

      Description copied from interface: `VaryingValue`

      Retrieves the input control point at the given index in the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined.

      Specified by:
        `getControlPointAt` in interface `VaryingValue`
      Parameters:
        `index` - 0-based index of the control point to retrieve.
      Returns:
        Input control point at the given index in the sequence of control points of this varying value.
      Throws:
        `IndexOutOfBoundsException` - The given index is outside the acceptable range for the current sequence of control points of this varying value.

    - #### removeControlPointAt

          @MediaListRemoveAt(value="PointList")
          public void removeControlPointAt(int index)
                                                                          throws IndexOutOfBoundsException

      Description copied from interface: `VaryingValue`

      This function removes the input control point at the given index in the sequence of control points of this varying value, each of which specifies a value and a time point at which the value is defined. Control points already existing at indices higher than the given index will be moved to the next lower index to accommodate.

      Specified by:
        `removeControlPointAt` in interface `VaryingValue`
      Parameters:
        `index` - Index of control point to remove from the sequence.
      Throws:
        `IndexOutOfBoundsException` - The index is outside acceptable range for the current sequence of control points of this varying value.

    - #### getInterpolatedValue

          public Object getInterpolatedValue(Rational inputValue)
                                      throws NullPointerException,
                                             NotImplementedException

      Description copied from interface: `VaryingValue`

      Returns the interpolated value of the varying value at a given time position, which should be a value between 0 and 1 inclusive. The data type of the value contained in the value returned will be the same as the data type of the parameter this varying value provides a value for, which is the same as the data type of all of the control points.

      Specified by:
        `getInterpolatedValue` in interface `VaryingValue`
      Parameters:
        `inputValue` - Time position along the operation group to find the interpolated value for.
      Returns:
        Buffer containing the interpolated value of the varying value at a given position.
      Throws:
        `NullPointerException` - The given input value is `null`.
        `NotImplementedException`
      See Also:
        `VaryingValue.getInterpolationDefinition()`, `InterpolationConstant`, `Parameter.getTypeDefinition()`, `ControlPoint.getTypeDefinition()`, `TypeDefinition.createValue(Object)`, `PropertyValue.getValue()`

    - #### getInterpolationDefinition

          @MediaProperty(uuid1=100729092,
                         uuid2=261,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="Interpolation",
                         typeName="InterpolationDefinitionWeakReference",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=19969,
                         symbol="Interpolation")
          public InterpolationDefinition getInterpolationDefinition()

      Description copied from interface: `VaryingValue`

      Returns the interpolation property of this varying value, which specifies the kind of interpolation to be used to find the value between control points.

      Specified by:
        `getInterpolationDefinition` in interface `VaryingValue`
      Returns:
        Interpolation definition referenced by this varying value.
      See Also:
        `VaryingValue.getInterpolatedValue(Rational)`, `InterpolationConstant`, `TypeDefinitions.InterpolationDefinitionWeakReference`

    - #### setInterpolationDefinition

          @MediaPropertySetter(value="Interpolation")
          public void setInterpolationDefinition(InterpolationDefinition interpolation)
                                                                                      throws NullPointerException

      Parameters:
        `interpolation` -
      Throws:
        `NullPointerException`

    - #### initializeInterpolation

          public static final InterpolationDefinition initializeInterpolation()

    - #### clone

          public VaryingValue clone()

      Description copied from interface: `InterchangeObject`

      Create a cloned copy of this interchange object.

      Specified by:
        `clone` in interface `MediaEntity`
      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `Parameter`
      Specified by:
        `clone` in interface `VaryingValue`
      Overrides:
        `clone` in class `ParameterImpl`
      Returns:
        Cloned copy of this interchange object.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.