1 26 27 package net.sourceforge.groboutils.codecoverage.v2.util; 28 29 30 37 public class ClassSignatureUtil 38 { 39 protected static ClassSignatureUtil s_instance = new ClassSignatureUtil(); 40 41 42 protected ClassSignatureUtil() 43 { 44 } 46 47 48 public static ClassSignatureUtil getInstance() 49 { 50 return s_instance; 51 } 52 53 54 public String createClassSignature( String className, long checksum ) 55 { 56 if (className == null) 57 { 58 throw new IllegalArgumentException ("no null args"); 59 } 60 return className + '-' + checksum; 61 } 62 63 64 public String getClassName( String signature ) 65 { 66 if (signature == null) 67 { 68 throw new IllegalArgumentException ( "No null args." ); 69 } 70 int pos = signature.indexOf( '-' ); 71 if (pos < 0) 72 { 73 return signature; 74 } 75 return signature.substring( 0, pos ); 76 } 77 } 78 79 | Popular Tags |