Class CRAMVersion

java.lang.Object
htsjdk.samtools.cram.common.CRAMVersion
All Implemented Interfaces:
Comparable<CRAMVersion>

public final class CRAMVersion extends Object implements Comparable<CRAMVersion>
A class to represent a version information, 3 number: major, minor and build number.
  • Constructor Details

    • CRAMVersion

      public CRAMVersion(int major, int minor)
    • CRAMVersion

      public CRAMVersion(String version)
  • Method Details

    • getMajor

      public int getMajor()
      Returns:
      the CRAM major version for this CRAMVersion
    • getMinor

      public int getMinor()
      Returns:
      the CRAM minor version for this CRAMVersion
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(CRAMVersion o)
      Compare with another version.
      Specified by:
      compareTo in interface Comparable<CRAMVersion>
      Parameters:
      o - another version
      Returns:
      0 if both versions are the same, a negative if the other version is higher and a positive otherwise.
    • compatibleWith

      public boolean compatibleWith(CRAMVersion cramVersion)
    • equals

      public boolean equals(Object o)
      Check if another version is exactly the same as this one.
      Overrides:
      equals in class Object
      Parameters:
      o - another version object
      Returns:
      true if both versions are the same, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object