1 2 3 4 package org.jgroups; 5 6 7 public class Version { 8 public static final String version="2.2.8"; 9 public static byte[] version_id={'0', '2', '2', '8'}; 10 public static final String cvs="$Id: Version.java,v 1.18.2.1 2005/05/30 09:47:56 belaban Exp $"; 11 12 public static void main(String [] args) { 13 System.out.println("\nVersion: \t" + version); 14 System.out.println("CVS: \t\t" + cvs); 15 System.out.println("History: \t(see doc/history.txt for details)\n"); 16 } 17 18 19 public static String printVersion() { 20 return "JGroups " + version + "[ " + cvs + "]"; 21 } 22 23 public static String printVersionId(byte[] v, int len) { 24 StringBuffer sb=new StringBuffer (); 25 if(v != null) { 26 if(len <= 0) 27 len=v.length; 28 for(int i=0; i < len; i++) 29 sb.append((char)v[i]); 30 } 31 return sb.toString(); 32 } 33 34 public static String printVersionId(byte[] v) { 35 StringBuffer sb=new StringBuffer (); 36 if(v != null) { 37 for(int i=0; i < v.length; i++) 38 sb.append((char)v[i]); 39 } 40 return sb.toString(); 41 } 42 43 47 public static void setVersion(byte[] v) { 48 version_id=v; 49 } 50 51 public static boolean compareTo(byte[] v) { 52 if(v == null) 53 return false; 54 if(v.length < version_id.length) 55 return false; 56 for(int i=0; i < version_id.length; i++) { 57 if(version_id[i] != v[i]) 58 return false; 59 } 60 return true; 61 } 62 63 public static int getLength() { 64 return version_id.length; 65 } 66 67 } | Popular Tags |