Changeset 1092 for extensions/net.sf.basedb.genepattern
- Timestamp:
- May 27, 2009, 10:00:02 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.genepattern/trunk/src/net/sf/basedb/genepattern/export/GctExporter.java
r1091 r1092 3 3 import java.sql.SQLException; 4 4 import java.util.Arrays; 5 import java.util.HashSet; 5 6 import java.util.List; 7 import java.util.Set; 6 8 7 9 import net.sf.basedb.core.BioAssay; … … 128 130 int index = 0; 129 131 132 boolean hasUniqueNames = checkUniqueNames(assays); 133 130 134 // Reporter fields 131 135 for (DynamicField field : reporterFields) … … 136 140 for (BioAssay ba : assays) 137 141 { 138 data[index++] = ba.getName();142 data[index++] = hasUniqueNames ? ba.getName() : ba.getName() + "-" + ba.getId(); 139 143 } 140 144 out.tablePrintData(data); … … 286 290 } 287 291 292 /** 293 Check if all bioassay names are unique. 294 @return TRUE if the names are unique, FALSE otherwise 295 */ 296 private boolean checkUniqueNames(List<BioAssay> assays) 297 { 298 Set<String> names = new HashSet<String>(); 299 for (BioAssay ba : assays) 300 { 301 if (names.contains(ba.getName())) return false; 302 names.add(ba.getName()); 303 } 304 return true; 305 } 306 307 288 308 }
Note: See TracChangeset
for help on using the changeset viewer.