1 5 6 30 31 package com.raptus.owxv3.api; 32 33 import java.util.*; 34 35 public class SearchInputObject extends Object 36 { 37 38 39 public SearchInputObject() { 40 } 41 42 45 public Vector loadFieldValues(String vmid,String field) 46 { 47 GlobalResources gres=new GlobalResources(); 48 return gres.loadValuesFor("nwslist"+vmid,field,null, false); 49 } 50 51 54 public Vector loadFieldValues(String vmid, String field, String locale) 55 { 56 GlobalResources gres = new GlobalResources(); 57 return gres.loadValuesFor("nwslist" + vmid, field, locale, false); 58 } 59 60 65 public Hashtable loadFieldLimits(String vmid,String field) 66 { 67 GlobalResources gres=new GlobalResources(); 68 Vector v = gres.loadValuesFor("nwslist" + vmid, field, null, true); 69 int min=Integer.MAX_VALUE, max = 0; 70 71 Double D; 72 String s; 73 for(int i = 0; i < v.size(); i++) 75 { 76 try 77 { 78 s = (String ) v.elementAt(i); 79 if(s.indexOf(' ')!=-1) 81 { 82 D = new Double ( s.substring(s.indexOf(' ')+1) ); 85 } 86 else 87 { 88 D = new Double (s); 89 } 90 if(D.intValue()>max) max=D.intValue(); 91 if(D.intValue()<min) min=D.intValue(); 92 }catch(NumberFormatException nfe) 93 { 94 continue; 95 }catch(ClassCastException cce) 96 { 97 break; 98 } 99 100 } Hashtable h=new Hashtable(); 102 h.put("MIN",new Integer (min)); 103 h.put("MAX",new Integer (max)); 104 return h; 105 } 106 107 } 109 110 | Popular Tags |