code: public boolean isCompatibleWith(String desired)
          throws NumberFormatException
      {
          if (specVersion == null || specVersion.length() < 1) {
              throw new NumberFormatException("Empty version string");
          }
  
          String [] sa = specVersion.split("\\.", -1);
          int [] si = new int[sa.length];
          for (int i = 0; i < sa.length; i++) {
              si[i] = Integer.parseInt(sa[i]);
              if (si[i] < 0)
                  throw NumberFormatException.forInputString("" + si[i]);
          }
  
          String [] da = desired.split("\\.", -1);
          int [] di = new int[da.length];
          for (int i = 0; i < da.length; i++) {
              di[i] = Integer.parseInt(da[i]);
              if (di[i] < 0)
                  throw NumberFormatException.forInputString("" + di[i]);
          }
  
          int len = Math.max(di.length, si.length);
          for (int i = 0; i < len; i++) {
              int d = (i < di.length ? di[i] : 0);
              int s = (i < si.length ? si[i] : 0);
              if (s < d)
                  return false;
              if (s > d)
                  return true;
          }
          return true;
      }
docs: Compare this package's specification version with a
  desired version. It returns true if
  this packages specification version number is greater than or equal
  to the desired version number. <p>
  
  Version numbers are compared by sequentially comparing corresponding
  components of the desired and specification strings.
  Each component is converted as a decimal integer and the values
  compared.
  If the specification value is greater than the desired
  value true is returned. If the value is less false is returned.
  If the values are equal the period is skipped and the next pair of
  components is compared.
  
  @param desired the version string of the desired version.
  @return true if this package's version number is greater
  than or equal to the desired version number
  
  @exception NumberFormatException if the desired or current version
  is not of the correct dotted form.