Module tvbrowser
Package devplugin

Class Version

  • All Implemented Interfaces:
    java.lang.Comparable<Version>

    public final class Version
    extends java.lang.Object
    implements java.lang.Comparable<Version>
    A class for the Version value off TV-Browser and it's plugins.
    • Constructor Summary

      Constructors 
      Constructor Description
      Version​(int major, int minor)
      Creates an instance of this class.
      Version​(int major, int minor, boolean isStable)
      Creates an instance of this class.
      Version​(int major, int minor, boolean isStable, java.lang.String name)
      Creates an instance of this class.
      Version​(int major, int minor, int subMinor)
      Creates an instance of this class.
      Version​(int major, int minor, int subMinor, boolean isStable)
      Creates an instance of this class.
      Version​(int major, int minor, int subMinor, boolean isStable, java.lang.String name)
      Creates an instance of this class.
      Version​(java.io.DataInputStream in)
      Creates an instance of this class from the given stream
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Version v)  
      boolean equals​(java.lang.Object obj)  
      int getMajor()
      Gets the major version.
      int getMinor()
      Gets the minor version.
      int getSubMinor()
      Gets the sub minor version
      int hashCode()  
      boolean isStable()
      Gets if this version is stable.
      java.lang.String toString()  
      void writeData​(java.io.DataOutputStream out)
      Writes this object to a stream.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor)
        Creates an instance of this class.
        Parameters:
        major - The major version (the first number).
        minor - The minor version (used for the second and third number).
      • Version

        public Version​(int major,
                       int minor,
                       boolean isStable)
        Creates an instance of this class.
        Parameters:
        major - The major version (the first number).
        minor - The minor version (used for the second and third number).
        isStable - If the version is stable.
      • Version

        public Version​(int major,
                       int minor,
                       boolean isStable,
                       java.lang.String name)
        Creates an instance of this class.
        Parameters:
        major - The major version (the first number).
        minor - The minor version (used for the second and third number).
        isStable - If the version is stable.
        name - The name String of this version, use null to let the name be created from the version numbers.
      • Version

        public Version​(int major,
                       int minor,
                       int subMinor)
        Creates an instance of this class.
        Parameters:
        major - The major version (the first number).
        minor - The minor version (used for the second and third number).
        subMinor - The sub minor version (the 4th number).
        Since:
        2.2.4/2.6
      • Version

        public Version​(int major,
                       int minor,
                       int subMinor,
                       boolean isStable)
        Creates an instance of this class.
        Parameters:
        major - The major version (the first number).
        minor - The minor version (used for the second and third number).
        subMinor - The sub minor version (the 4th number).
        isStable - If the version is stable.
        Since:
        2.2.4/2.6
      • Version

        public Version​(int major,
                       int minor,
                       int subMinor,
                       boolean isStable,
                       java.lang.String name)
        Creates an instance of this class.
        Parameters:
        major - The major version (the first number).
        minor - The minor version (used for the second and third number).
        subMinor - The sub minor version (the 4th number).
        isStable - If the version is stable.
        name - The name String of this version, use null to let the name be created from the version numbers.
        Since:
        2.2.4/2.6
      • Version

        public Version​(java.io.DataInputStream in)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
        Creates an instance of this class from the given stream

        Parameters:
        in - The stream to read the version from.
        Throws:
        java.io.IOException - Thrown if something went wrong.
        java.lang.ClassNotFoundException - Thrown if something went wrong.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isStable

        public boolean isStable()
        Gets if this version is stable.
        Returns:
        True if the version is stable, false otherwise.
      • getMajor

        public int getMajor()
        Gets the major version.
        Returns:
        The major version (first number).
      • getMinor

        public int getMinor()
        Gets the minor version.
        Returns:
        The minor version (seconds and third number).
      • getSubMinor

        public int getSubMinor()
        Gets the sub minor version
        Returns:
        The sub minor version (4th number).
      • compareTo

        public int compareTo​(Version v)
                      throws java.lang.ClassCastException
        Specified by:
        compareTo in interface java.lang.Comparable<Version>
        Throws:
        java.lang.ClassCastException
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • writeData

        public void writeData​(java.io.DataOutputStream out)
                       throws java.io.IOException
        Writes this object to a stream.

        Parameters:
        out - The stream to write to.
        Throws:
        java.io.IOException - Thrown if something went wrong.