Beispiel #1
0
 /**
  * tokenize the pattern string as a numeric range
  *
  * @return min max range values
  * @throws Exception On badness
  */
 public Real[] getNumericRange() throws Exception {
   if (range == null) {
     range = new Real[] {null, null};
     List toks = StringUtil.split(pattern, ",");
     if (toks.size() == 0) {
       throw new IllegalStateException("Bad format for numeric range:" + pattern);
     }
     String tok1 = toks.get(0).toString();
     String tok2 = ((toks.size() == 1) ? tok1 : toks.get(1).toString());
     range[0] = ucar.visad.Util.toReal(tok1);
     range[1] = ucar.visad.Util.toReal(tok2);
   }
   return range;
 }