X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=engine%2Fcompbio%2Fengine%2Farchive%2FArchiveManager.java;fp=engine%2Fcompbio%2Fengine%2Farchive%2FArchiveManager.java;h=9b9979e36c893d9a58f44a1e49046c44900414a4;hb=006363dc999cef4e9c49dd6a38ea0d78cbb62472;hp=dabaf3ad257547dd89a264de592100fe1686cc18;hpb=6823d2f36ff55b7ab11d674e3fe4d04dc57d6bbf;p=proteocache.git diff --git a/engine/compbio/engine/archive/ArchiveManager.java b/engine/compbio/engine/archive/ArchiveManager.java index dabaf3a..9b9979e 100644 --- a/engine/compbio/engine/archive/ArchiveManager.java +++ b/engine/compbio/engine/archive/ArchiveManager.java @@ -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 { 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 { */ 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 { */ @Override public boolean hasNext() { - //return input.hasNext(); + // return input.hasNext(); return true; } @@ -81,12 +74,10 @@ public class ArchiveManager implements Iterator { 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 { * 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 { 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);