Apply formatting
[proteocache.git] / engine / compbio / engine / archive / ArchiveManager.java
index dabaf3a..9b9979e 100644 (file)
@@ -1,10 +1,8 @@
 package compbio.engine.archive;
 
-import java.io.File;
 import java.io.FileNotFoundException;
-import java.io.InputStream;
+
 import java.util.Iterator;
-import java.util.Scanner;
 
 //import compbio.util.Util;
 
@@ -17,11 +15,12 @@ import java.util.Scanner;
  */
 public class ArchiveManager implements Iterator<ArchivedJob> {
        Archive archive;
-       //private final Scanner input;
+
+       // private final Scanner input;
        /**
         * Delimiter for the scanner
         */
-       //private final String DELIM = ">";
+       // private final String DELIM = ">";
 
        /**
         * Header data can contain non-ASCII symbols and read in UTF8
@@ -36,25 +35,19 @@ public class ArchiveManager implements Iterator<ArchivedJob> {
         */
        public ArchiveManager(final String mainPath) throws FileNotFoundException {
                /*
-               input = new Scanner(new File(mainPath), "UTF8");
-               input.useDelimiter(DELIM);
-               Runtime.getRuntime().addShutdownHook(new Thread() {
-
-                       @Override
-                       public void run() {
-                               if (input != null) {
-                                       input.close();
-                               }
-                       }
-               });
-               */
+                * input = new Scanner(new File(mainPath), "UTF8");
+                * input.useDelimiter(DELIM); Runtime.getRuntime().addShutdownHook(new
+                * Thread() {
+                * 
+                * @Override public void run() { if (input != null) { input.close(); } }
+                * });
+                */
        }
-       
+
        public ArchiveManager(Archive ar) {
                archive = ar;
        }
 
-
        /**
         * {@inheritDoc}
         * 
@@ -63,7 +56,7 @@ public class ArchiveManager implements Iterator<ArchivedJob> {
         */
        @Override
        public boolean hasNext() {
-               //return input.hasNext();
+               // return input.hasNext();
                return true;
        }
 
@@ -81,12 +74,10 @@ public class ArchiveManager implements Iterator<ArchivedJob> {
        public ArchivedJob next() {
                String path = "bla-bla-bla";
                /*
-               String path = input.next();
-               while (fastaHeader.indexOf("\n") < 0 && input.hasNext()) {
-                       path = fastaHeader.concat(">");
-                       path = fastaHeader.concat(input.next());
-               }
-               */
+                * String path = input.next(); while (fastaHeader.indexOf("\n") < 0 &&
+                * input.hasNext()) { path = fastaHeader.concat(">"); path =
+                * fastaHeader.concat(input.next()); }
+                */
                return new ArchivedJob(path);
        }
 
@@ -105,7 +96,7 @@ public class ArchiveManager implements Iterator<ArchivedJob> {
         * instance of the FastaReader will be possible after calling this method.
         */
        public void close() {
-               //input.close();
+               // input.close();
        }
 
        private static ArchivedJob toFastaSequence(final String singleFastaEntry) {
@@ -115,11 +106,9 @@ public class ArchiveManager implements Iterator<ArchivedJob> {
 
                int nlineidx = singleFastaEntry.indexOf("\n");
                if (nlineidx < 0) {
-                       throw new AssertionError(
-                                       "The FASTA sequence must contain the header information"
-                                                       + " separated by the new line from the sequence. Given sequence does not appear to "
-                                                       + "contain the header! Given data:\n "
-                                                       + singleFastaEntry);
+                       throw new AssertionError("The FASTA sequence must contain the header information"
+                                       + " separated by the new line from the sequence. Given sequence does not appear to "
+                                       + "contain the header! Given data:\n " + singleFastaEntry);
                }
                String header = singleFastaEntry.substring(0, nlineidx);