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

tv.amwa.maj.model

## Interface Package

- All Superinterfaces:
    InterchangeObject, MediaEntity, MetadataObject, WeakReferenceTarget
  All Known Subinterfaces:
    CompositionPackage, MaterialPackage, Package, QCompositionPackage, QMaterialPackage, SourcePackage
  All Known Implementing Classes:
    CompositionPackageImpl, MaterialPackageImpl, PackageImpl, SourcePackageImpl

      public interface Package
      extends InterchangeObject, WeakReferenceTarget

  Specifies a package, which can describe a composition, essence, or physical media. A package has a unique identifier and consists of metadata.

  See Also:
    `ContentStorage.getPackages()`, `EssenceData.getFilePackage()`, `PackageID`, `TypeDefinitions.PackageWeakReference`, `TypeDefinitions.PackageStrongReference`, `TypeDefinitions.PackageStrongReferenceSet`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `EventTrack` | `appendNewEventTrack(Rational editRate, Segment segment, int trackId, String trackName)` Creates and returns a new event track with the given edit rate, as well as appending it to the list of tracks of this package.
    `StaticTrack` | `appendNewStaticTrack(Segment segment, int trackId, String trackName)` Creates and returns a new static track with the given property values, as well as appending it to the list of tracks of this package.
    `TimelineTrack` | `appendNewTimelineTrack(Rational editRate, Segment segment, int trackId, String trackName, long origin)` Creates and returns a new timeline track with the given property values, as well as appending it to this package.
    `void` | `appendPackageAttribute(String name, String value)` Create and append a new attribute to the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).
    `void` | `appendPackageAttribute(TaggedValue packageAttribute)` Appends an existing attribute to the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).
    `void` | `appendPackageKLVData(KLVData packageKLVData)` Appends an existing user KLV data item to the collection of KLV data items contained in this package.
    `void` | `appendPackageTrack(Track packageTrack)` Appends the given tracks to the list contained in this package.
    `void` | `appendPackageUserComment(String category, String comment)` Creates a user-defined comment and adds it to the collection of comments of this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
    `void` | `appendPackageUserComment(TaggedValue packageUserComment)` Append a user comment defined by an existing tagged value to the collection of user comments of this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
    `void` | `changeReference(PackageID oldPackageId, PackageID newPackageId)` Finds all source clips in this package that refer to the specified old package and changes the references to point to the newly specified package.
    `void` | `clearPackageAttributes()` Clears the list of package attributes of this package, omitting this optional property.
    `void` | `clearPackageKLVData()` Clears the list of KLV data items of this package, omitting this optional property.
    `void` | `clearPackageTracks()` Clears the list of package tracks attached to this package.
    `void` | `clearPackageUserComments()` Clears the list of user comments attached to this package, omitting this optional property.
    `Package` | `clone()` Create a cloned copy of this package.
    `Package` | `cloneExternal(Depend resolveDependencies, IncludedMedia includedMedia, AAFFile clonedFile)` Clones this package, and optionally all dependent packages, to a package that can be used in an external file, keeping the same package id.
    `Package` | `copy(String destinationPackageName)` Creates and returns a new copy of this package in the same AAF file.
    `int` | `countPackageAttributes()` Returns the number of attributes in the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).
    `int` | `countPackageKLVData()` Returns the total number of KLV data items in the collection of KLV data items contained in this package.
    `int` | `countPackageTracks()` Returns the number of tracks contained in this package.
    `int` | `countPackageUserComments()` Returns the total number of user comments attached to this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
    `TimeStamp` | `getCreationTime()` Returns the creation time of this package, which is the date and time when this package was originally created.
    `List<? extends TaggedValue>` | `getPackageAttributes()` Returns the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).
    `PackageID` | `getPackageID()` Returns the unique (package identifier) for this package.
    `List<? extends KLVData>` | `getPackageKLVData()` Returns the collection of KLV data items contained in this package.
    `TimeStamp` | `getPackageLastModified()` Returns the modification time for this package, which is the date and time when this package was last modified.
    `String` | `getPackageName()` Returns the name of this package, as displayed to the end user.
    `Track` | `getPackageTrackAt(int index)` Returns the track at the given index through the list of tracks contained in this package.
    `List<? extends Track>` | `getPackageTracks()` Return the list of tracks contained in this package.
    `AUID` | `getPackageUsage()` Returns the usage of this package.
    `List<? extends TaggedValue>` | `getPackageUserComments()` Returns the collection of all user comments attached to this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
    `void` | `insertPackageTrackAt(int index, Track packageTrack)` Inserts the given track into the list of tracks contained in this package at the given index.
    `Track` | `lookupPackageTrack(int trackId)` Finds and returns the track with the associated track id from the list of tracks for this package.
    `TimecodeValue` | `offsetToPackageTimecode(Segment timecodeSegment, long offset)` Calculates the timecode at the given offset into the given timecode segment.
    `void` | `prependPackageTrack(Track packageTrack)` Prepends the given track to the list of tracks contained in this package.
    `void` | `removePackageAttribute(TaggedValue packageAttribute)` Removes the given attribute from the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).
    `void` | `removePackageKLVData(KLVData packageKLVData)` Removes the given item of KLV data from the collection of KLV data items of this package.
    `void` | `removePackageTrackAt(int index)` Removes the track at the given index from the list of tracks contained in this package.
    `void` | `removePackageUserComment(TaggedValue packageUserComment)` Removes the given user comment from the collection of user comments of this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
    `void` | `setCreationTime(TimeStamp creationTime)` Sets the creation time of this package, which is the date and time when this package was originally created.
    `void` | `setPackageID(PackageID packageId)` Sets the unique (package identifier) for this package.
    `void` | `setPackageLastModified(TimeStamp lastModified)` Sets the modification time for this package, which is the date and time when this package was last modified.
    `void` | `setPackageName(String name)` Sets the name of this package, as displayed to the end user.
    `void` | `setPackageUsage(AUID packageUsage)` Sets this package's usage.

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

      `getAUID, getWeakTargetReference`

- - ### Method Detail

    - #### getPackageID

          @PackageIDType
          PackageID getPackageID()

      Returns the unique (package identifier) for this package.

      Returns:
        Unique package id that identifies this package.

    - #### setPackageID

          void setPackageID(@PackageIDType
                            PackageID packageId)
                     throws NullPointerException

      Sets the unique (package identifier) for this package.

      Parameters:
        `packageId` - New package identifier to set for this package.
      Throws:
        `NullPointerException` - The given package identifier is `null`.
      See Also:
        `Forge.makePackageID(byte[], byte, byte, byte, byte, AUID)`

    - #### setPackageName

          void setPackageName(@AAFString
                              String name)

      Sets the name of this package, as displayed to the end user. Set this optional property to `null` to omit it.

      Parameters:
        `name` - Name of this package.

    - #### getPackageName

          @AAFString
          String getPackageName()
                                    throws PropertyNotPresentException

      Returns the name of this package, as displayed to the end user. This is an optional property.

      Returns:
        Name of this package.
      Throws:
        `PropertyNotPresentException` - The optional name property is not present in this package.

    - #### countPackageTracks

          @NumTracks
          int countPackageTracks()

      Returns the number of tracks contained in this package.

      Returns:
        Number of tracks contained by this package.

    - #### appendPackageTrack

          void appendPackageTrack(Track packageTrack)
                           throws NullPointerException,
                                  TrackExistsException

      Appends the given tracks to the list contained in this package. Note that the index of a package track in the list of package tracks is not the same as its track id.

      Parameters:
        `packageTrack` - Track to append to the list of tracks described by this package.
      Throws:
        `NullPointerException` - The given track is `null`.
        `TrackExistsException` - A track with the same track id as the given track is already present in this package.

    - #### prependPackageTrack

          void prependPackageTrack(Track packageTrack)
                            throws NullPointerException,
                                   TrackExistsException

      Prepends the given track to the list of tracks contained in this package. Note that the index of a package track in the list of tracks is not the same as its track id.

      Parameters:
        `packageTrack` - Track to prepend to the list of tracks described by this package.
      Throws:
        `NullPointerException` - The given track is `null`.
        `TrackExistsException` - A track with the same track id as the given track is already present in this package.

    - #### insertPackageTrackAt

          void insertPackageTrackAt(@UInt32
                                    int index,
                                    Track packageTrack)
                             throws NullPointerException,
                                    IndexOutOfBoundsException,
                                    TrackExistsException

      Inserts the given track into the list of tracks contained in this package at the given index. All existing tracks at the given and higher index will be moved up by one index to accommodate the new track. Note that the index of a track in the list of tracks is not the same as its track id.

      Parameters:
        `index` - Index where the track is to be inserted.
        `packageTrack` - Track to be inserted into the list contained in this package.
      Throws:
        `NullPointerException` - The given track is `null`.
        `IndexOutOfBoundsException` - Index is outside the acceptable range for the list of tracks contained in this package.
        `TrackExistsException` - A track with the same track id as the given track is already present in this package.

    - #### removePackageTrackAt

          void removePackageTrackAt(@UInt32
                                    int index)
                             throws IndexOutOfBoundsException

      Removes the track at the given index from the list of tracks contained in this package. All existing tracks at indices higher than the given index will be moved on one index to accommodate.

      Parameters:
        `index` - Index of the track to be removed from the list of tracks of this package.
      Throws:
        `IndexOutOfBoundsException` - Index is outside the acceptable range for the list of tracks contained in this package.

    - #### getPackageTrackAt

          Track getPackageTrackAt(@UInt32
                                  int index)
                           throws IndexOutOfBoundsException

      Returns the track at the given index through the list of tracks contained in this package.

      Parameters:
        `index` - Index of track to be returned.
      Returns:
        Track at the specified index through the list of this package.
      Throws:
        `IndexOutOfBoundsException` - Index is outside the acceptable range for the list of tracks contained in this package.

    - #### getPackageTracks

          List<? extends Track> getPackageTracks()

      Return the list of tracks contained in this package.

      Returns:
        Shallow copy of the list of tracks contained in this package.
      See Also:
        `TypeDefinitions.TrackStrongReferenceVector`

    - #### getPackageLastModified

          TimeStamp getPackageLastModified()

      Returns the modification time for this package, which is the date and time when this package was last modified.

      Returns:
        Modification time for this package.

    - #### setPackageLastModified

          void setPackageLastModified(TimeStamp lastModified)
                               throws NullPointerException

      Sets the modification time for this package, which is the date and time when this package was last modified. The modification time is initially set to the time that this package was created.

      The MAJ API does not maintain the modification time every time that a package is updated. Therefore, this method should be called explicitly to change the modification time for this package.

      Parameters:
        `lastModified` - Modification time to set for this package.
      Throws:
        `NullPointerException` - The given modification time is `null`.
      See Also:
        `Forge.now()`, `Forge.makeTimeStamp(java.util.Calendar)`

    - #### getCreationTime

          TimeStamp getCreationTime()

      Returns the creation time of this package, which is the date and time when this package was originally created.

      Returns:
        Creation time for this package.

    - #### setCreationTime

          void setCreationTime(TimeStamp creationTime)
                        throws NullPointerException

      Sets the creation time of this package, which is the date and time when this package was originally created. The creation time is initially set to the time that this package was created. Therefore, this method should only be called to explicitly to change the creation time.

      Parameters:
        `creationTime` - The creation time for this package.
      Throws:
        `NullPointerException` - The given creation time is `null`.
      See Also:
        `Forge.now()`, `Forge.makeTimeStamp(java.util.Calendar)`

    - #### appendPackageUserComment

          void appendPackageUserComment(@AAFString
                                        String category,
                                        @AAFString
                                        String comment)
                                 throws NullPointerException

      Creates a user-defined comment and adds it to the collection of comments of this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

      This method creates a new tagged value, initializes it with the specified comment name/value pair, and appends it to the comment collection.

      Parameters:
        `category` - The name associated with the new comment to create.
        `comment` - The corresponding value, or description, of the new comment.
      Throws:
        `NullPointerException` - One or both of the name and/or value values is/are `null`.

    - #### appendPackageUserComment

          void appendPackageUserComment(TaggedValue packageUserComment)
                                 throws NullPointerException

      Append a user comment defined by an existing tagged value to the collection of user comments of this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

      Parameters:
        `packageUserComment` - User comment to append to the collection of user comments of this component.
      Throws:
        `NullPointerException` - The given user comment value is `null`.
      See Also:
        `TaggedValueDefinition`

    - #### countPackageUserComments

          @UInt32
          int countPackageUserComments()

      Returns the total number of user comments attached to this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

      Returns:
        Total number of comments attached to this package.

    - #### clearPackageUserComments

          void clearPackageUserComments()

      Clears the list of user comments attached to this package, omitting this optional property.

    - #### clearPackageTracks

          void clearPackageTracks()

      Clears the list of package tracks attached to this package.

    - #### getPackageUserComments

          List<? extends TaggedValue> getPackageUserComments()
                                                      throws PropertyNotPresentException

      Returns the collection of all user comments attached to this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns). This is an optional property.

      Returns:
        Shallow copy of the collection of all comments attached to this package.
      Throws:
        `PropertyNotPresentException` - No optional user comments are present for this package.
      See Also:
        `TypeDefinitions.TaggedValueStrongReferenceVector`

    - #### removePackageUserComment

          void removePackageUserComment(TaggedValue packageUserComment)
                                 throws NullPointerException,
                                        PropertyNotPresentException,
                                        ObjectNotFoundException

      Removes the given user comment from the collection of user comments of this package, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

      Parameters:
        `packageUserComment` - User comment to remove from the collection of this package.
      Throws:
        `NullPointerException` - The given tagged value user comment is `null`.
        `PropertyNotPresentException` - No user comments are present for this package.
        `ObjectNotFoundException` - The given comment is not in the collection of user comments of this package.

    - #### appendNewTimelineTrack

          TimelineTrack appendNewTimelineTrack(Rational editRate,
                                               Segment segment,
                                               @TrackID
                                               int trackId,
                                               @AAFString
                                               String trackName,
                                               @PositionType
                                               long origin)
                                        throws NullPointerException,
                                               IllegalArgumentException,
                                               TrackExistsException

      Creates and returns a new timeline track with the given property values, as well as appending it to this package.

      Parameters:
        `editRate` - Units of time for the new timeline track.
        `segment` - Value for the new timeline track.
        `trackId` - Integer to be used to refer to the track.
        `trackName` - Name of the new timeline track, or `null` to omit this optional property.
        `origin` - Specifies the offset used to resolve source clip references to source material in the new timeline track, measured in according to the edit rate of the new track. A positive value means that the first sample of the essence is earlier than the zero position. A negative value of origin means that the zero position is earlier than the first sample of the essence.
      Returns:
        The newly created timeline tracl, which is also appended to the list of tracks of this package.
      Throws:
        `NullPointerException` - One or more of the arguments is `null`.
        `IllegalArgumentException` - The given track id is negative.
        `TrackExistsException` - The given track id is already used to to identify a track in this package.

    - #### offsetToPackageTimecode

          TimecodeValue offsetToPackageTimecode(Segment timecodeSegment,
                                                @PositionType
                                                long offset)
                                         throws NullPointerException,
                                                TimecodeNotFoundException

      Calculates the timecode at the given offset into the given timecode segment. If the given timecode segment is `null`, the method will search for the track containing a timecode segment in this package and will use that instead.

      Parameters:
        `timecodeSegment` - Timecode segment to search for, or `null` to select the one from this package.
        `offset` - Offset into the segment, expressed in edit unit's for the associated track.
      Returns:
        Associated timecode for the given offset.
      Throws:
        `NullPointerException` - The given timecode segment is `null`.
        `TimecodeNotFoundException` - A timecode track was not found in this package.

    - #### lookupPackageTrack

          Track lookupPackageTrack(@TrackID
                                   int trackId)
                            throws TrackNotFoundException

      Finds and returns the track with the associated track id from the list of tracks for this package.

      Parameters:
        `trackId` - The requested track id from the list of tracks of this package.
      Returns:
        Matching track.
      Throws:
        `TrackNotFoundException` - A track with the given track id was not found in this package.

    - #### changeReference

          void changeReference(PackageID oldPackageId,
                               PackageID newPackageId)
                        throws NullPointerException

      Finds all source clips in this package that refer to the specified old package and changes the references to point to the newly specified package.

      This method traverses through all the package reference chains of all of the tracks of this package looking for source clips. All source clips that have a source id property that matches the old package id, changes them to the new package id.

      Parameters:
        `oldPackageId` - Package id to match against the source id property of a source clip.
        `newPackageId` - If a match is found, change the package id of the source clip to the given one.
      Throws:
        `NullPointerException` - One or both of the given package ids is/are `null`.
      See Also:
        `SourceReferenceSegment.getSourcePackageID()`

    - #### cloneExternal

          Package cloneExternal(Depend resolveDependencies,
                                IncludedMedia includedMedia,
                                AAFFile clonedFile)
                         throws NullPointerException

      Clones this package, and optionally all dependent packages, to a package that can be used in an external file, keeping the same package id.

      The method clones the specified this package into a new destination package, with the same package id, in the given destination file. If the resolve dependencies flag is set to follow, the method also clones all packages referenced by this package.

      If the include media flag is set, the method also copies the essence data associated with this package and returns the destination package, also cloning all private data. If the media data is not in the file, the function does not attempt to find it in another file and clone it. Both AAF files must be open before you call this function and both must have the same version number.

      Parameters:
        `resolveDependencies` - Sets whether the clone of this package also clones all of its references.
        `includedMedia` - Sets whether any media data included with this package should be copied into the clone or not.
        `clonedFile` - File in which to create the cloned package.
      Returns:
        Externally valid cloned version of this package, created according to the given parameters.
      Throws:
        `NullPointerException` - One or more of the given arguments is/are `null` and all are required.

    - #### copy

          Package copy(@AAFString
                       String destinationPackageName)
                throws NullPointerException

      Creates and returns a new copy of this package in the same AAF file. The method gives the returned new package a new package id and the given name. The method also copies all private data.

      Parameters:
        `destinationPackageName` - Name for the newly created, copied version of this package.
      Returns:
        Newly created copy of this package.
      Throws:
        `NullPointerException` - The given destination name for the new package is `null`.

    - #### appendPackageKLVData

          void appendPackageKLVData(KLVData packageKLVData)
                             throws NullPointerException

      Appends an existing user KLV data item to the collection of KLV data items contained in this package.

      Parameters:
        `packageKLVData` - KLV data item to add to the collection of data items contained in this package.
      Throws:
        `NullPointerException` - The given KLV data item is `null`.
      See Also:
        `KLVDataDefinition`

    - #### countPackageKLVData

          @UInt32
          int countPackageKLVData()

      Returns the total number of KLV data items in the collection of KLV data items contained in this package.

      Returns:
        Total number of KLV data items contained in this package.

    - #### clearPackageKLVData

          void clearPackageKLVData()

      Clears the list of KLV data items of this package, omitting this optional property.

    - #### getPackageKLVData

          List<? extends KLVData> getPackageKLVData()
                                             throws PropertyNotPresentException

      Returns the collection of KLV data items contained in this package. This is an optional property.

      Returns:
        Shallow copy of the collection of KLV data items contained in this package.
      Throws:
        `PropertyNotPresentException` - No KLV data values are present for this package.
      See Also:
        `TypeDefinitions.KLVDataStrongReferenceVector`

    - #### removePackageKLVData

          void removePackageKLVData(KLVData packageKLVData)
                             throws NullPointerException,
                                    PropertyNotPresentException,
                                    ObjectNotFoundException

      Removes the given item of KLV data from the collection of KLV data items of this package.

      Parameters:
        `packageKLVData` - KLV data to remove from the set of KLV data of this package.
      Throws:
        `NullPointerException` - Argument is `null`.
        `PropertyNotPresentException` - No KLV data is present for this package.
        `ObjectNotFoundException` - The given KLV data object could not be found in the collection of KLV data items for this package.

    - #### appendPackageAttribute

          void appendPackageAttribute(@AAFString
                                      String name,
                                      @AAFString
                                      String value)
                               throws NullPointerException

      Create and append a new attribute to the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).

      This method creates a new tagged value, initializes it with the specified attribute name/value pair, and appends it to the attribute collection.

      Parameters:
        `name` - Name of the new attribute.
        `value` - Value of the new attribute.
      Throws:
        `NullPointerException` - One or both of the arguments is/are `null`.
      See Also:
        `appendPackageAttribute(TaggedValue)`

    - #### appendPackageAttribute

          void appendPackageAttribute(TaggedValue packageAttribute)
                               throws NullPointerException

      Appends an existing attribute to the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).

      Parameters:
        `packageAttribute` - Attribute to append to the collection of attributes contained in this package.
      Throws:
        `NullPointerException` - The given attribute is `null`.
      See Also:
        `appendPackageAttribute(String, String)`

    - #### countPackageAttributes

          @UInt32
          int countPackageAttributes()

      Returns the number of attributes in the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).

      Returns:
        Number of attributes in the collection of attributes contained in this package.

    - #### clearPackageAttributes

          void clearPackageAttributes()

      Clears the list of package attributes of this package, omitting this optional property.

    - #### getPackageAttributes

          List<? extends TaggedValue> getPackageAttributes()
                                                    throws PropertyNotPresentException

      Returns the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).

      Returns:
        Shallow copy of the collection of attributes contained in this package.
      Throws:
        `PropertyNotPresentException` - No attributes are present for this package.
      See Also:
        `TypeDefinitions.TaggedValueStrongReferenceVector`

    - #### removePackageAttribute

          void removePackageAttribute(TaggedValue packageAttribute)
                               throws NullPointerException,
                                      PropertyNotPresentException,
                                      ObjectNotFoundException

      Removes the given attribute from the collection of attributes contained in this package, which specify attributes that are under the control of the application (for example filter control).

      Parameters:
        `packageAttribute` - Attribute to remove from the collection of attributes contained in this package.
      Throws:
        `NullPointerException` - The given attribute is `null`.
        `PropertyNotPresentException` - No attributes are present for this package.
        `ObjectNotFoundException` - The given attribute could not be found in collection of attributes contained in this package.

    - #### setPackageUsage

          void setPackageUsage(AUID packageUsage)
                        throws NullPointerException

      Sets this package's usage.

      Possible values include:

      - `UsageType.AdjustedClip`
      - `UsageType.LowerLevel`
      - `UsageType.SubClip`
      - `UsageType.Template`
      - `UsageType.TopLevel`

      Set this optional property to `null` to omit it, which is used to specify that a clip references only file, import, tape or film sources.

      The built-in usage codes are specified in the AAF edit protocol.

      Parameters:
        `packageUsage` - This package's usage code.
      Throws:
        `NullPointerException` - The given usage is `null`.
      See Also:
        `UsageType`, `TypeDefinitions.UsageType`

    - #### getPackageUsage

          AUID getPackageUsage()
                        throws PropertyNotPresentException

      Returns the usage of this package. This is an optional property.

      The built-in usage codes are specified in the AAF edit protocol.

      Returns:
        Usage of this package.
      Throws:
        `PropertyNotPresentException` - The optional usage code property is not present in this package.
      See Also:
        `UsageType`, `TypeDefinitions.UsageType`

    - #### appendNewStaticTrack

          StaticTrack appendNewStaticTrack(Segment segment,
                                           @TrackID
                                           int trackId,
                                           @AAFString
                                           String trackName)
                                    throws NullPointerException,
                                           IllegalArgumentException,
                                           TrackExistsException

      Creates and returns a new static track with the given property values, as well as appending it to the list of tracks of this package.

      Parameters:
        `segment` - Segment to use to create a new static track.
        `trackId` - Track id to assign to the new static track.
        `trackName` - Name for the new static track, or `null` to omit this optional property.
      Returns:
        Newly created static track, which is also appended to the list of tracks of this package.
      Throws:
        `NullPointerException` - The given segment is `null`.
        `IllegalArgumentException` - The given track id is negative.
        `TrackExistsException` - A track with the given track id is already present in this package.
      See Also:
        `appendPackageTrack(Track)`

    - #### appendNewEventTrack

          EventTrack appendNewEventTrack(Rational editRate,
                                         Segment segment,
                                         @TrackID
                                         int trackId,
                                         @AAFString
                                         String trackName)
                                  throws NullPointerException,
                                         IllegalArgumentException,
                                         TrackExistsException

      Creates and returns a new event track with the given edit rate, as well as appending it to the list of tracks of this package.

      Parameters:
        `editRate` - Edit rate property for the new event track.
        `segment` - Segment for the new event track.
        `trackId` - Track ID for the new event track.
        `trackName` - Name for the new event track, or `null` to omit this optional property.
      Returns:
        The newly created event track, which is also appended as a track to the list of tracks of this package.
      Throws:
        `NullPointerException` - One or both of the edit rate and/or segment arguments is `null`.
        `IllegalArgumentException` - The track id is negative or the given segment is not valid according to the conditional rules for event track.
        `TrackExistsException` - A track with the given track id is already present in this package.
      See Also:
        `appendPackageTrack(Track)`

    - #### clone

          Package clone()

      Create a cloned copy of this package.

      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `MediaEntity`
      Returns:
        Cloned copy of this package.

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