if (style != null && val == DateFormat.DEFAULT)
if (styleIsPattern)
  void setLocale (Locale loc)  {    if (type == null)      ;    else if (type.equals("number"))      {	formatClass = java.lang.Number.class;	if (style == null)	  format = NumberFormat.getInstance(loc);	else if (style.equals("currency"))	  format = NumberFormat.getCurrencyInstance(loc);	else if (style.equals("percent"))	  format = NumberFormat.getPercentInstance(loc);	else if (style.equals("integer"))	  {	    NumberFormat nf = NumberFormat.getNumberInstance(loc);	    nf.setMaximumFractionDigits(0);	    nf.setGroupingUsed(false);	    format = nf;	  }	else	  {	    format = NumberFormat.getNumberInstance(loc);	    DecimalFormat df = (DecimalFormat) format;	    df.applyPattern(style);	  }      }    else if (type.equals("time") || type.equals("date"))      {	formatClass = java.util.Date.class;	int val = DateFormat.DEFAULT;	if (style == null)	  ;	else if (style.equals("short"))	  val = DateFormat.SHORT;	else if (style.equals("medium"))	  val = DateFormat.MEDIUM;	else if (style.equals("long"))	  val = DateFormat.LONG;	else if (style.equals("full"))	  val = DateFormat.FULL;	if (type.equals("time"))	  format = DateFormat.getTimeInstance(val, loc);	else	  format = DateFormat.getDateInstance(val, loc);	if (style != null && val == DateFormat.DEFAULT)	  {	    SimpleDateFormat sdf = (SimpleDateFormat) format;	    sdf.applyPattern(style);	  }      }    else if (type.equals("choice"))      {	formatClass = java.lang.Number.class;	if (style == null)	  throw new	    IllegalArgumentException ("style required for choice format");	format = new ChoiceFormat (style);      }  }