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

tv.amwa.maj.model.impl

## Class ControlPointImpl

- java.lang.Object
- - tv.amwa.maj.model.impl.InterchangeObjectImpl
  - - tv.amwa.maj.model.impl.ControlPointImpl

- All Implemented Interfaces:
    Serializable, Cloneable, MediaEntity, MetadataObject, XMLSerializable, ControlPoint, InterchangeObject

      @MediaClass(uuid1=218169601,
                  uuid2=257,
                  uuid3=6400,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="ControlPoint",
                  description="The ControlPoint class specifies a value and a time point and is used to specify an effect control value.",
                  symbol="ControlPoint")
      public class ControlPointImpl
      extends InterchangeObjectImpl
      implements ControlPoint, Serializable, XMLSerializable, Cloneable

  Implements a value and a time point (position) that is used to specify an effect control value. Control points must be added to a varying value that is then added to the operation group describing the effect.

  See Also:
    `TypeDefinitions.ControlPointStrongReference`, `TypeDefinitions.ControlPointStrongReferenceVector`, Serialized Form

- - ### Field Summary

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

      `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ControlPointImpl()`
    `ControlPointImpl(TypeDefinition varyingValueType, Rational controlPointTime, PropertyValue controlPointValue)`
    `ControlPointImpl(VaryingValue varyingValue, Rational controlPointTime, PropertyValue controlPointValue)` Creates and initializes a new control point object, which specifies a value and a time point and is used to specify an effect control value.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ControlPoint` | `clone()` Create a cloned copy of this interchange object.
    `String` | `getComment()` Include a comment when serializing a value to XML.
    `String` | `getControlPointTimeString()`
    `PropertyValue` | `getControlPointValue()` Returns the control point value at the control point's position (time), which contains the type and value as a property value.
    `byte[]` | `getControlPointValuePersist()`
    `EditHintType` | `getEditHint()` Returns the edit hint of the control point, which describes how to alter the position (time) of the operation group is made longer or shorter.
    `Rational` | `getTime()` Returns the time property of this control point, which specifies the time within the varying value segment for which the value is defined.
    `TypeDefinition` | `getTypeDefinition()` Returns the type definition of the value of this control point.
    `static Rational` | `initializeControlPointTime()`
    `static PropertyValue` | `initializeControlPointValue()`
    `void` | `setControlPointTime(Rational controlPointTime)` Sets the position of the control point within an operation group, which specifies the time within the varying value segment for which the value is defined.
    `void` | `setControlPointTimeString(String controlPointTime)`
    `void` | `setControlPointValue(PropertyValue controlPointValue)` Set the data value describing this control point at the control point's position (time).
    `void` | `setControlPointValuePersist(byte[] indirectBytes)`
    `void` | `setEditHint(EditHintType editHint)` Sets the control point edit hint value, which describes how to alter the position (time) if the operation group is made longer or shorter.

    - ### 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.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`

    - ### Methods inherited from interface tv.amwa.maj.io.xml.XMLSerializable

      `appendXMLChildren`

- - ### Constructor Detail

    - #### ControlPointImpl

          public ControlPointImpl()

    - #### ControlPointImpl

          public ControlPointImpl(VaryingValue varyingValue,
                                  Rational controlPointTime,
                                  PropertyValue controlPointValue)
                           throws NullPointerException,
                                  RationalRangeException

      Creates and initializes a new control point object, which specifies a value and a time point and is used to specify an effect control value.

      Parameters:
        `varyingValue` - A varying value. This determines the type of this control point through the parameter definition.
        `controlPointTime` - Specifies the time within the VaryingValue segment for which the value is defined, with a value between 0 and 1.
        `controlPointValue` - Control point type and value.
      Throws:
        `NullPointerException` - One or more of the arguments is `null` and all values are required.
        `RationalRangeException` - Rational time value is outside the inclusive range 0.0 to 1.0.
        `ClassCastException` - Cannot cast the given Java value to the given AAF type definition.

    - #### ControlPointImpl

          public ControlPointImpl(TypeDefinition varyingValueType,
                                  Rational controlPointTime,
                                  PropertyValue controlPointValue)

  - ### Method Detail

    - #### getEditHint

          @MediaProperty(uuid1=87033096,
                         uuid2=0,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="EditHint",
                         typeName="EditHintType",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=6660,
                         symbol="EditHint")
          public EditHintType getEditHint()
                                                                                                                                                                                                                                                                                                                                                                            throws PropertyNotPresentException

      Description copied from interface: `ControlPoint`

      Returns the edit hint of the control point, which describes how to alter the position (time) of the operation group is made longer or shorter. This is an optional property.

      Specified by:
        `getEditHint` in interface `ControlPoint`
      Returns:
        A hint to be used if the effect starting time or length is changed during editing.
      Throws:
        `PropertyNotPresentException` - The optional edit hint property is not present for this control point.

    - #### setEditHint

          @MediaPropertySetter(value="EditHint")
          public void setEditHint(EditHintType editHint)

      Description copied from interface: `ControlPoint`

      Sets the control point edit hint value, which describes how to alter the position (time) if the operation group is made longer or shorter. Set this optional property to `null` to omit it.

      Specified by:
        `setEditHint` in interface `ControlPoint`
      Parameters:
        `editHint` - Specifies a hint to be used if the effect starting time or length is changed during editing.

    - #### getTime

          @MediaProperty(uuid1=117571843,
                         uuid2=4098,
                         uuid3=256,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="ControlPointTime",
                         aliases="Time",
                         typeName="Rational",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=6659,
                         symbol="ControlPointTime")
          public Rational getTime()

      Description copied from interface: `ControlPoint`

      Returns the time property of this control point, which specifies the time within the varying value segment for which the value is defined. The value of the time property should be between&nbps;0 and 1 inclusive.

      Specified by:
        `getTime` in interface `ControlPoint`
      Returns:
        Time property of this control point.

    - #### setControlPointTime

          @MediaPropertySetter(value="ControlPointTime")
          public void setControlPointTime(Rational controlPointTime)
                                                                                  throws RationalRangeException,
                                                                                         NullPointerException

      Description copied from interface: `ControlPoint`

      Sets the position of the control point within an operation group, which specifies the time within the varying value segment for which the value is defined. The value is expressed as a rational value between from 0 to 1.

      Specified by:
        `setControlPointTime` in interface `ControlPoint`
      Parameters:
        `controlPointTime` - Control point time.
      Throws:
        `RationalRangeException` - The rational value is outside the range 0 to 1.
        `NullPointerException` - The given time value is `null`.

    - #### initializeControlPointTime

          public static final Rational initializeControlPointTime()

    - #### getTypeDefinition

          public TypeDefinition getTypeDefinition()

      Description copied from interface: `ControlPoint`

      Returns the type definition of the value of this control point.

      Specified by:
        `getTypeDefinition` in interface `ControlPoint`
      Returns:
        Type definition associated with the control point data value inside this object.
      See Also:
        `TypeDefinitionIndirect`

    - #### getControlPointValue

          @MediaProperty(uuid1=87033101,
                         uuid2=0,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="ControlPointValue",
                         aliases="Value",
                         typeName="Indirect",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=6658,
                         symbol="ControlPointValue")
          public PropertyValue getControlPointValue()

      Description copied from interface: `ControlPoint`

      Returns the control point value at the control point's position (time), which contains the type and value as a property value.

      Specified by:
        `getControlPointValue` in interface `ControlPoint`
      Returns:
        Control point value.
      See Also:
        `TypeDefinitionIndirect`, `ControlPoint.getTypeDefinition()`, `PropertyValue.getType()`, `PropertyValue.getValue()`

    - #### setControlPointValue

          @MediaPropertySetter(value="ControlPointValue")
          public void setControlPointValue(PropertyValue controlPointValue)
                                                                                    throws NullPointerException,
                                                                                           ClassCastException

      Description copied from interface: `ControlPoint`

      Set the data value describing this control point at the control point's position (time). The value must be a property value containing the type and current value for the control point.

      To create a control value of a specific type, use the `createValue()` method of a `type definition`. To access a type definition, use the `ControlPoint.getTypeDefinition()` method as follows:

                controlPoint.setControlPointValue(
                    controlPoint.getTypeDefinition().createValue(42));

      Alternatively, you can retrieve the value of any other property using its property definition. To retrieve the property value of a property called foo from an instance called bar:

                ClassDefinition barClassDef =
                    ClassDefinitionWarehouse.forClass(bar.getClass());
                PropertyDefinition fooDefinition =
                    barClassDef.lookupPropertyDefinition("foo");
                PropertyValue fooValue =
                   fooDefinition.getPropertyValue(bar);

      Specified by:
        `setControlPointValue` in interface `ControlPoint`
      Parameters:
        `controlPointValue` - The value of this control point at its position (time).
      Throws:
        `NullPointerException` - The given control point value is `null`.
        `ClassCastException` - Cannot cast the given value to the defined type for this control point.
      See Also:
        `TypeDefinition.createValue(Object)`, `PropertyValue.getValue()`, `ConstantValue.setValue(PropertyValue)`

    - #### initializeControlPointValue

          public static final PropertyValue initializeControlPointValue()

    - #### clone

          public ControlPoint 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 `ControlPoint`
      Specified by:
        `clone` in interface `InterchangeObject`
      Overrides:
        `clone` in class `InterchangeObjectImpl`
      Returns:
        Cloned copy of this interchange object.

    - #### getComment

          public String getComment()

      Description copied from interface: `XMLSerializable`

      Include a comment when serializing a value to XML. The comment will be inserted as the first child node of the element representing the class.

      Specified by:
        `getComment` in interface `XMLSerializable`
      Overrides:
        `getComment` in class `InterchangeObjectImpl`
      Returns:
        Comment to add as the first child node of the element representing this class.

    - #### getControlPointTimeString

          public String getControlPointTimeString()

    - #### setControlPointTimeString

          public void setControlPointTimeString(String controlPointTime)

    - #### getControlPointValuePersist

          public byte[] getControlPointValuePersist()
                                             throws NotSerializableException,
                                                    NullPointerException,
                                                    IllegalPropertyValueException,
                                                    InsufficientSpaceException

      Throws:
        `NotSerializableException`
        `NullPointerException`
        `IllegalPropertyValueException`
        `InsufficientSpaceException`

    - #### setControlPointValuePersist

          public void setControlPointValuePersist(byte[] indirectBytes)

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