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

tv.amwa.maj.model

## Interface OperationDefinition

- All Superinterfaces:
    DefinitionObject, InterchangeObject, MediaEntity, MetadataObject, WeakReferenceTarget
  All Known Implementing Classes:
    OperationDefinitionImpl

      public interface OperationDefinition
      extends DefinitionObject

  Specifies the definition of an operation that is performed on an array of segments. Operation definitions specify which parameters are possible for an operation, while an operation group specifies specific parameters and input segments for a particular operation invocation.

  See Also:
    `OperationConstant`, `Warehouse.lookup(Class, String)`, `Dictionary.getOperationDefinitions()`, `Transition.getTransitionOperation()`, `OperationGroup.getOperationDefinition()`, `TypeDefinitions.OperationDefinitionWeakReference`, `TypeDefinitions.OperationDefinitionWeakReferenceVector`, `TypeDefinitions.OperationDefinitionStrongReference`, `TypeDefinitions.OperationDefinitionStrongReferenceSet`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `ISTIMEWARP_DEFAULT` Default value for the is time warp property, which is false.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addParameterDefinition(ParameterDefinition parameterDefinition)` Add a parameter definition to the unordered collection of parameter definitions of the defined operation, which specify the parameters that can be used as controls for the operation.
    `void` | `appendDegradeToOperation(OperationDefinition operationDefinition)` Append an operation definition to the degrade-to list of operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
    `void` | `clearDegradeToOperations()` Clears the list degrade-to operations of this operation definition, omitting this optional property.
    `OperationDefinition` | `clone()` Create a cloned copy of this operation definition.
    `int` | `countDegradeToOperations()` Returns the number of degrade-to operations in this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
    `int` | `countOperationParametersDefined()` Return the number of parameter definitions of the defined operation, which specify the parameters that can be used as controls for the operation.
    `int` | `getBypass()` Gets the bypass media segment index, which specifies the array index (1-based) of the input segment which is the primary input.
    `List<? extends OperationDefinition>` | `getDegradeToOperations()` Returns the list of degrade-to operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
    `boolean` | `getIsTimeWarp()` Returns `true` if the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.
    `AUID` | `getOperationCategory()` Returns an AUID identifying the category of the defined operation, which specifies the kind of operation, such as video effect, audio effect, or 3D operation.
    `DataDefinition` | `getOperationDataDefinition()` Returns the kind of data that is produced by the defined operation.
    `int` | `getOperationInputCount()` Returns the number of input media segments of the defined operation definition.
    `Set<? extends ParameterDefinition>` | `getOperationParametersDefined()` Returns the collection of parameter definitions of the defined operation, which specify the parameters that can be used as controls for the operation.
    `void` | `insertDegradeToOperationAt(int index, OperationDefinition operationDefinition)` Insert an operation definition into the degrade-to list of definitions of the defined operation at the given index.
    `boolean` | `isTimeWarp()` Returns `true` if the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.
    `ParameterDefinition` | `lookupOperationParameter(AUID parameterDefinition)` Looks up and returns the parameter definition corresponding to the given identifier from the collection of defined parameters of the defined operation.
    `void` | `prependDegradeToOperation(OperationDefinition operationDefinition)` Prepend an operation definition to the degrade-to list of operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
    `void` | `removeDegradeToOperationAt(int index)` Removes the indexed operation definition from the degrade-to list of operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
    `void` | `setBypass(Integer bypass)` Sets the bypass media segment index, which specifies the array index (1-based) of the input segment which is the primary input.
    `void` | `setIsTimeWarp(Boolean isTimeWarp)` Set to `true` to indicate that the the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.
    `void` | `setOperationCategory(AUID category)` Sets an AUID identifying the category of the defined operation, which specifies the kind of operation, such as video effect, audio effect, or 3D operation.
    `void` | `setOperationDataDefinition(DataDefinition operationDataDefinition)` Sets the kind of data that is produced by the defined operation.
    `void` | `setOperationInputCount(int operationInputCount)` Sets the number of input media segments for the defined operation.

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

      `getAUID, getDescription, getName, setDescription, setName`

    - ### 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.industry.WeakReferenceTarget

      `getWeakTargetReference`

- - ### Field Detail

    - #### ISTIMEWARP_DEFAULT

          static final boolean ISTIMEWARP_DEFAULT

      Default value for the is time warp property, which is false.

      See Also:
        `isTimeWarp()`, `setIsTimeWarp(Boolean)`, Constant Field Values

  - ### Method Detail

    - #### getOperationDataDefinition

          DataDefinition getOperationDataDefinition()

      Returns the kind of data that is produced by the defined operation.

      Returns:
        Kind of data produced by the defined operation.
      See Also:
        `TypeDefinitions.DataDefinitionWeakReference`, `Warehouse.lookup(Class, String)`

    - #### setOperationDataDefinition

          void setOperationDataDefinition(DataDefinition operationDataDefinition)
                                   throws NullPointerException

      Sets the kind of data that is produced by the defined operation.

      Parameters:
        `operationDataDefinition` - Kind of data produced by the defined operation.
      Throws:
        `NullPointerException` - The given data definition is `null`.
      See Also:
        `TypeDefinitions.DataDefinitionWeakReference`, `Warehouse.lookup(Class, String)`

    - #### isTimeWarp

          @Bool
          boolean isTimeWarp()

      Returns `true` if the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.

      If this optional property is not present, its default value of false is returned.

      Returns:
        Does this operation change the total length of segments in the associated operation group?
      See Also:
        `ISTIMEWARP_DEFAULT`, `getIsTimeWarp()`

    - #### getIsTimeWarp

          @Bool
          boolean getIsTimeWarp()

      Returns `true` if the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.

      If this optional property is not present, its default value of false is returned.

      Returns:
        Does this operation change the total length of segments in the associated operation group?
      See Also:
        `ISTIMEWARP_DEFAULT`, `isTimeWarp()`

    - #### setIsTimeWarp

          void setIsTimeWarp(@Bool
                             Boolean isTimeWarp)

      Set to `true` to indicate that the the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.

      The default value for this optional property is false. To omit this optional property, call this method with `null`.

      Parameters:
        `isTimeWarp` - Does this operation change the total length of segments in the associated operation group?
      See Also:
        `ISTIMEWARP_DEFAULT`

    - #### prependDegradeToOperation

          void prependDegradeToOperation(OperationDefinition operationDefinition)
                                  throws NullPointerException

      Prepend an operation definition to the degrade-to list of operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. Use this function to add an operation definition to be scanned first when searching for a replacement, to be considered as a more desirable alternate operation.

      Parameters:
        `operationDefinition` - Degrade-to operation definition to add.
      Throws:
        `NullPointerException` - The given degrade-to operation definition is `null`.

    - #### appendDegradeToOperation

          void appendDegradeToOperation(OperationDefinition operationDefinition)
                                 throws NullPointerException

      Append an operation definition to the degrade-to list of operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. Use this function to add an operation definition to be scanned last when searching for a replacement, to be considered as a less desirable alternate operation.

      Parameters:
        `operationDefinition` - Degrade-to operation to append.
      Throws:
        `NullPointerException` - The given degrade-to operation definition is `null`.

    - #### insertDegradeToOperationAt

          void insertDegradeToOperationAt(@UInt32
                                          int index,
                                          OperationDefinition operationDefinition)
                                   throws NullPointerException,
                                          IndexOutOfBoundsException

      Insert an operation definition into the degrade-to list of definitions of the defined operation at the given index. The degrade-to list of operation definitions specify simpler operations that an application can substitute for the defined operation if it cannot process it. Operation definitions already existing at the given and higher indices will be moved up to the next higher index to accommodate.

      Parameters:
        `index` - 0-based index at which the operation definition is to be inserted.
        `operationDefinition` - Degrade-to operation definition to insert at the specified index.
      Throws:
        `NullPointerException` - The given operation definition is `null`.
        `IndexOutOfBoundsException` - The index is outside the acceptable range for the current degrade-to list.

    - #### removeDegradeToOperationAt

          void removeDegradeToOperationAt(@UInt32
                                          int index)
                                   throws IndexOutOfBoundsException

      Removes the indexed operation definition from the degrade-to list of operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. Operation definitions already existing at indices higher than the given index will be moved down to the next lower index to accommodate.

      Parameters:
        `index` - 0-based index of operation definition to remove from the degrade-to list of the defined operation
      Throws:
        `IndexOutOfBoundsException` - The index is outside the range acceptable range for the current degrade-to list.

    - #### getDegradeToOperations

          List<? extends OperationDefinition> getDegradeToOperations()
                                                              throws PropertyNotPresentException

      Returns the list of degrade-to operation definitions of the defined operation, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. The definitions are ordered from the most desirable to the least desirable alternative.

      Returns:
        Shallow copy of the list of degrade-to operation definitions of the defined operation.
      Throws:
        `PropertyNotPresentException` - No degrade to operations are present for this operation definition.

    - #### countDegradeToOperations

          @UInt32
          int countDegradeToOperations()

      Returns the number of degrade-to operations in this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.

      Returns:
        Number of degrade-to operations listed in this operation definition.

    - #### clearDegradeToOperations

          void clearDegradeToOperations()

      Clears the list degrade-to operations of this operation definition, omitting this optional property.

    - #### getOperationCategory

          AUID getOperationCategory()
                             throws PropertyNotPresentException

      Returns an AUID identifying the category of the defined operation, which specifies the kind of operation, such as video effect, audio effect, or 3D operation. This is an optional property.

      Returns:
        Identifier for the category of the defined operation.
      Throws:
        `PropertyNotPresentException` - The optional operation category property is not present for the defined operation.
      See Also:
        `OperationCategoryType`, `TypeDefinitions.OperationCategoryType`

    - #### setOperationCategory

          void setOperationCategory(AUID category)

      Sets an AUID identifying the category of the defined operation, which specifies the kind of operation, such as video effect, audio effect, or 3D operation. Set this optional property to `null` to omit it.

      Parameters:
        `category` - AUID indicating the category of the defined operation.
      See Also:
        `OperationCategoryType`, `TypeDefinitions.OperationCategoryType`

    - #### getOperationInputCount

          @Int32
          int getOperationInputCount()

      Returns the number of input media segments of the defined operation definition. A value of -1 indicates that the effect can have any number of input segments.

      Returns:
        Number of input media segments for the defined operation.

    - #### setOperationInputCount

          void setOperationInputCount(@Int32
                                      int operationInputCount)

      Sets the number of input media segments for the defined operation. A value of -1 indicates that the effect can have any number of input segments.

      Parameters:
        `operationInputCount` - Number of input media segments of the defined operation.

    - #### getBypass

          @UInt32
          int getBypass()
                         throws PropertyNotPresentException

      Gets the bypass media segment index, which specifies the array index (1-based) of the input segment which is the primary input. This value allows the client application to pick one of the inputs (foreground, background, etc.) to stand in for the effect if it is not available and none of the degrade-to effects are available. This is an optional property.

      Note that the methods of the C-based AAF reference implementation use 0-based indexing.

      Returns:
        1-based index of the bypass media segment for the defined operation.
      Throws:
        `PropertyNotPresentException` - The optional bypass property is not present in the defined operation.

    - #### setBypass

          void setBypass(@UInt32
                         Integer bypass)

      Sets the bypass media segment index, which specifies the array index (1-based) of the input segment which is the primary input. This value allows the client application to pick one of the inputs (foreground, background, etc.) to stand in for the effect if it is not available, and none of the degrade to effects are available. Set this optional property to `null` to omit it.

      Parameters:
        `bypass` - Index of bypass media segment for the defined operation.

    - #### addParameterDefinition

          void addParameterDefinition(ParameterDefinition parameterDefinition)
                               throws NullPointerException,
                                      ObjectAlreadyAttachedException

      Add a parameter definition to the unordered collection of parameter definitions of the defined operation, which specify the parameters that can be used as controls for the operation.

      Parameters:
        `parameterDefinition` - Parameter definition object to add.
      Throws:
        `NullPointerException` - The given parameter definition is `null`.
        `ObjectAlreadyAttachedException` - Parameter definition is already present within this operation definition.
      See Also:
        `OperationGroup.addParameter(Parameter)`

    - #### getOperationParametersDefined

          Set<? extends ParameterDefinition> getOperationParametersDefined()
                                                                    throws PropertyNotPresentException

      Returns the collection of parameter definitions of the defined operation, which specify the parameters that can be used as controls for the operation.

      Returns:
        Shallow copy of the collection of parameter definitions of the defined operation.
      Throws:
        `PropertyNotPresentException` - No parameter definitions are present for the defined operation.
      See Also:
        `OperationGroup.addParameter(Parameter)`, `TypeDefinitions.ParameterDefinitionStrongReferenceSet`

    - #### countOperationParametersDefined

          @UInt32
          int countOperationParametersDefined()

      Return the number of parameter definitions of the defined operation, which specify the parameters that can be used as controls for the operation.

      Returns:
        Number of parameter definitions of the defined operation.

    - #### lookupOperationParameter

          ParameterDefinition lookupOperationParameter(AUID parameterDefinition)
                                                throws NullPointerException,
                                                       ObjectNotFoundException

      Looks up and returns the parameter definition corresponding to the given identifier from the collection of defined parameters of the defined operation.

      Parameters:
        `parameterDefinition` - Identity of the parameter definition to look up.
      Returns:
        Matching parameter definition with the given identifier.
      Throws:
        `NullPointerException` - The given identifier for a parameter definition is `null`.
        `ObjectNotFoundException` - The given identifier does not correspond to a parameter definition of the defined operation.

    - #### clone

          OperationDefinition clone()

      Create a cloned copy of this operation definition.

      Specified by:
        `clone` in interface `DefinitionObject`
      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `MediaEntity`
      Returns:
        Cloned copy of this operation definition.

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