1 19 24 25 package org.netbeans.modules.j2ee.sun.share.configbean; 26 27 32 public abstract class J2EEBaseVersion implements Comparable { 33 34 37 private final String j2eeModuleVersion; private final int numericModuleVersion; 40 41 private final String j2eeSpecVersion; private final int numericSpecVersion; 44 45 private final String publicId; 46 private final String systemId; 47 48 50 protected J2EEBaseVersion(String moduleVersion, int nv, 51 String specVersion, int nsv, String pubId, String sysId) { 52 j2eeModuleVersion = moduleVersion; 53 numericModuleVersion = nv; 54 j2eeSpecVersion = specVersion; 55 numericSpecVersion = nsv; 56 publicId = pubId; 57 systemId = sysId; 58 } 59 60 64 public String toString() { 65 return j2eeModuleVersion; 66 } 67 68 72 public String getSunPublicId() { 73 return publicId; 74 } 75 76 80 public String getSunSystemId() { 81 return systemId; 82 } 83 84 91 public int compareSpecification(J2EEBaseVersion target) { 92 if(numericSpecVersion < target.numericSpecVersion) { 93 return -1; 94 } else if(numericSpecVersion > target.numericSpecVersion) { 95 return 1; 96 } else { 97 return 0; 98 } 99 } 100 101 109 protected int numericCompare(J2EEBaseVersion target) { 110 if(numericModuleVersion < target.numericModuleVersion) { 111 return -1; 112 } else if(numericModuleVersion > target.numericModuleVersion) { 113 return 1; 114 } else { 115 return 0; 116 } 117 } 118 119 133 } 134 | Popular Tags |