Changeset 3541
- Timestamp:
- Jun 29, 2007, 4:46:10 PM (16 years ago)
- Location:
- branches/2.3.2/src/plugins/core/net/sf/basedb/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3.2/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java
r3538 r3541 90 90 import java.net.URL; 91 91 import java.sql.SQLException; 92 import java.util.AbstractSet; 92 93 import java.util.ArrayList; 93 94 import java.util.Arrays; 94 95 import java.util.Collection; 95 96 import java.util.Collections; 96 import java.util.Comparator;97 97 import java.util.EnumSet; 98 98 import java.util.HashMap; … … 745 745 Boolean mergeReporters = (Boolean) configuration.getValue(geneAveragesParameter.getName()); 746 746 747 TreeMap<String, String> parameters = new TreeMap<String, String>(new Comparator<String>() 748 { 749 /** 750 * To make the keys orderd by the same order they are added 751 */ 752 public int compare(String o1, String o2) 753 { 754 return 1; 755 } 756 }); 747 ListMap<String, String> parameters = new ListMap<String, String>(); 757 748 for (PluginParameter<?> pp : getJobParametersFromXML(String.valueOf(configuration.getValue(jobParametersParameter.getName())))) 758 749 { 759 if (pp != null) 760 { 761 String name = pp.getName(); 762 Object value = job.getValue(name); 763 parameters.put(name, value == null ? "" : value.toString()); 764 } 750 String name = pp.getName(); 751 Object value = job.getValue(name); 752 parameters.put(name, value == null ? "" : value.toString()); 765 753 } 766 754 … … 1825 1813 } 1826 1814 } 1815 1816 private class ListMap<K, V> extends java.util.AbstractMap<K, V> 1817 { 1818 private List<K> keys = new ArrayList<K>(); 1819 private List<V> values = new ArrayList<V>(); 1820 1821 @Override 1822 public Set<java.util.Map.Entry<K, V>> entrySet() 1823 { 1824 throw new UnsupportedOperationException(); 1825 } 1826 1827 @Override 1828 public V put(K key, V value) 1829 { 1830 V ret = null; 1831 int index = keys.indexOf(key); 1832 if (index == -1) 1833 { 1834 keys.add(key); 1835 values.add(value); 1836 } 1837 else 1838 { 1839 keys.set(index, key); 1840 ret = values.set(index, value); 1841 } 1842 return ret; 1843 } 1844 1845 @Override 1846 public V get(Object key) 1847 { 1848 if (key == null) throw new NullPointerException(); 1849 int index = keys.indexOf(key); 1850 V ret = null; 1851 if (index != -1) 1852 { 1853 ret = values.get(index); 1854 } 1855 return ret; 1856 } 1857 1858 @Override 1859 public boolean isEmpty() 1860 { 1861 return keys.isEmpty(); 1862 } 1863 1864 @Override 1865 public Set<K> keySet() 1866 { 1867 return new AbstractSet<K>() 1868 { 1869 @Override 1870 public Iterator<K> iterator() 1871 { 1872 return Collections.unmodifiableList(keys).iterator(); 1873 } 1874 1875 @Override 1876 public int size() 1877 { 1878 return keys.size(); 1879 } 1880 }; 1881 } 1882 1883 } 1827 1884 1828 1885 private enum Base1JobParameterType -
branches/2.3.2/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java
r3470 r3541 246 246 } 247 247 248 249 248 private void exportBaseFileSectionAssays(PrintWriter out, DbControl dc, BioAssaySet bas) 250 249 { … … 273 272 } 274 273 275 276 274 private void exportBaseFileSectionHead(PrintWriter out, Map<String, String> parameters) 277 275 { 278 276 out.println("BASEfile"); 277 279 278 if (!parameters.isEmpty()) 280 279 { 281 Set<String> keys = new HashSet<String>(parameters.keySet());282 if ( keys.remove("section"))280 List<String> keys = new ArrayList<String>(parameters.keySet()); 281 if ("section".equals(keys.get(0))) 283 282 { 284 283 out.println("section\t"+parameters.get("section")); 284 keys = keys.subList(1, keys.size()); 285 } 286 if (keys.contains("section")) 287 { 288 throw new BaseException("The parameters can't have a parameter 'section' in the middle of the list."); 285 289 } 286 290 for (String key : keys) … … 872 876 873 877 878 @Override 874 879 public Plugin.MainType getMainType() 875 880 { … … 938 943 private DbControl dc; 939 944 private BioAssaySet bas; 945 @Override 940 946 protected void begin(DbControl dc) 941 947 { … … 943 949 } 944 950 951 @Override 945 952 @SuppressWarnings("unchecked") 946 953 protected void performExport(ExportOutputStream out, ProgressReporter progress) … … 995 1002 } 996 1003 1004 @Override 997 1005 protected void end(boolean success) 998 1006 { 999 1007 this.dc = null; 1000 1008 } 1009 1010 @Override 1001 1011 protected String getSuccessMessage() 1002 1012 { 1003 1013 return "Bioassay set '" + bas.getName() + "' exported successfully"; 1004 1014 } 1005 1006 1015 1007 1016 @Override
Note: See TracChangeset
for help on using the changeset viewer.