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

tv.amwa.maj.record

## Interface VersionType

- All Superinterfaces:
    Comparable<VersionType>
  All Known Implementing Classes:
    VersionTypeImpl

      public interface VersionType
      extends Comparable<VersionType>

  Specifies a 2-byte version number, consisting of a major and minor component.

  To make values of this type, use the following methods from the MAJ forge:

  - From its component parts: `Forge.makeVersion(byte, byte)`;
  - A zero value: `Forge.zeroVersion()`;
  - From a string representation as generated by `toString()`: `Forge.parseVersion(String)`.
  See Also:
    `TypeDefinitions.VersionType`, `ProductVersion`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `VersionType` | `clone()` Create a cloned copy of this version value.
    `int` | `compareTo(VersionType o)` Compare this version number to the given version number.
    `byte` | `getMajor()` Returns the major component of the version number.
    `byte` | `getMinor()` Returns the minor component of the version number.
    `void` | `setMajor(byte major)` Sets the major component of the version number.
    `void` | `setMinor(byte minor)` Sets the minor component of the version number.
    `String` | `toString()` Formats the version number as a string representation.

- - ### Method Detail

    - #### getMajor

          @Int8
          byte getMajor()

      Returns the major component of the version number.

      Returns:
        Major component of the version number.

    - #### setMajor

          void setMajor(@Int8
                        byte major)

      Sets the major component of the version number.

      Parameters:
        `major` - Major component of the version number.

    - #### getMinor

          @Int8
          byte getMinor()

      Returns the minor component of the version number.

      Returns:
        Minor component of the version number.

    - #### setMinor

          void setMinor(@Int8
                        byte minor)

      Sets the minor component of the version number.

      Parameters:
        `minor` - Minor component of the version number.

    - #### compareTo

          int compareTo(VersionType o)
                 throws NullPointerException

      Compare this version number to the given version number.

      Specified by:
        `compareTo` in interface `Comparable<VersionType>`
      Parameters:
        `o` - Version number to compare with this one.
      Returns:
        A value of `-1`if this version number is less than the given one, `1` if this version is greater and `0` if the two version numbers and equal.``
      Throws:
        `NullPointerException` - The given value is `null`.

    - #### clone

          VersionType clone()

      Create a cloned copy of this version value.

      Returns:
        Cloned copy of this version value.

    - #### toString

          String toString()

      Formats the version number as a string representation. This format is:

      <major>`.`<minor>

      Note that "`2.10`" is a later version than "`2.9`".

      To convert the representation created by this method back into a version type value, use `Forge.parseVersion(String)`.

      Overrides:
        `toString` in class `Object`
      See Also:
        `Forge.parseVersion(String)`

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