@Test public void is_upgradable() { assertTrue(Const.isUpgradable(VERSION)); if (Const.MINOR != 0) assertTrue(Const.isUpgradable(VERSION - 1)); assertFalse(Const.isUpgradable(VERSION + 1)); if (Const.MAJOR != 0) assertFalse(Const.isUpgradable(VERSION - 0x10000)); assertFalse(Const.isUpgradable(VERSION + 0x10000)); }
public static boolean isUpgradable(short maj, short min) { return (maj == MAJOR && min <= MINOR); }
Const { public static boolean isUpgradable(short maj, short min) { return (maj == MAJOR && min <= MINOR); } }
Const { public static boolean isUpgradable(short maj, short min) { return (maj == MAJOR && min <= MINOR); } private  Const(); }
Const { public static boolean isUpgradable(short maj, short min) { return (maj == MAJOR && min <= MINOR); } private  Const(); static int version_from_majmin(short maj, short min); static short version_major(int ver); static short version_minor(int ver); static boolean isUpgradable(short maj, short min); static boolean isUpgradable(int version); static boolean needsUpgrade(short maj, short min); static boolean needsUpgrade(int version); static Validation validateHeader(tsfile_mimeheader hdr); static int validateHeaderOrThrow(tsfile_mimeheader hdr); static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr); static int validateHeaderOrThrow(XdrDecodingStream decoder); static boolean validateHeaderOrThrowForWrite(XdrDecodingStream decoder); static void writeMimeHeader(XdrEncodingStream encoder, short major, short minor); static void writeMimeHeader(XdrEncodingStream encoder); }
Const { public static boolean isUpgradable(short maj, short min) { return (maj == MAJOR && min <= MINOR); } private  Const(); static int version_from_majmin(short maj, short min); static short version_major(int ver); static short version_minor(int ver); static boolean isUpgradable(short maj, short min); static boolean isUpgradable(int version); static boolean needsUpgrade(short maj, short min); static boolean needsUpgrade(int version); static Validation validateHeader(tsfile_mimeheader hdr); static int validateHeaderOrThrow(tsfile_mimeheader hdr); static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr); static int validateHeaderOrThrow(XdrDecodingStream decoder); static boolean validateHeaderOrThrowForWrite(XdrDecodingStream decoder); static void writeMimeHeader(XdrEncodingStream encoder, short major, short minor); static void writeMimeHeader(XdrEncodingStream encoder); static byte[] MAGIC; static final int MIME_HEADER_LEN; static final short MAJOR; static final short MINOR; }