+ /**
+ * Convert the array of PDBEntry into an array with no filename repeated
+ *
+ * @param pdbs
+ * @return
+ */
+ static PDBEntry[] getUniquePdbFiles(PDBEntry[] pdbs)
+ {
+ if (pdbs == null)
+ {
+ return null;
+ }
+ List<PDBEntry> uniques = new ArrayList<PDBEntry>();
+ List<String> filesSeen = new ArrayList<String>();
+ for (PDBEntry entry : pdbs)
+ {
+ String file = entry.getFile();
+ if (file == null)
+ {
+ uniques.add(entry);
+ }
+ else if (!filesSeen.contains(file))
+ {
+ uniques.add(entry);
+ filesSeen.add(file);
+ }
+ }
+ return uniques.toArray(new PDBEntry[uniques.size()]);
+ }
+