public GempakParameter getParameter ( String name ) { GempakParameter param = paramMap . get ( name ) ; if ( param == null ) { // try the regex list Set < String > keys = templateParamMap . keySet ( ) ; if ( ! keys . isEmpty ( ) ) { for ( String key : keys ) { Pattern p = Pattern . compile ( key ) ; Matcher m = p . matcher ( name ) ; if ( m . matches ( ) ) { //System.out.println("found match " + key + " for " + name); String value = m . group ( 1 ) ; GempakParameter match = templateParamMap . get ( key ) ; param = new GempakParameter ( match . getNumber ( ) , name , match . getDescription ( ) + " (" + value + " hour)" , match . getUnit ( ) , match . getDecimalScale ( ) ) ; paramMap . put ( name , param ) ; break ; } } } } return param ; }
Get the parameter for the given name