Merge branch 'improvement/JAL-4250_secondary_structure_annotation_antialias' into...
[jalview.git] / src / jalview / io / JPredFile.java
index 026c879..9f8ac4e 100755 (executable)
@@ -25,6 +25,8 @@
  */
 package jalview.io;
 
+import java.util.Locale;
+
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Sequence;
@@ -68,6 +70,8 @@ public class JPredFile extends AlignFile
   /**
    * Creates a new JPredFile object.
    * 
+   * BH allows File or String
+   * 
    * @param inFile
    *          DOCUMENT ME!
    * @param sourceType
@@ -76,7 +80,7 @@ public class JPredFile extends AlignFile
    * @throws IOException
    *           DOCUMENT ME!
    */
-  public JPredFile(String inFile, DataSourceType sourceType)
+  public JPredFile(Object inFile, DataSourceType sourceType)
           throws IOException
   {
     super(inFile, sourceType);
@@ -146,7 +150,7 @@ public class JPredFile extends AlignFile
   @Override
   public void parse() throws IOException
   {
-    // JBPNote log.System.out.println("all read in ");
+    // JBPNote log.jalview.bin.Console.outPrintln("all read in ");
     String line;
     QuerySeqPosition = -1;
     noSeqs = 0;
@@ -207,7 +211,7 @@ public class JPredFile extends AlignFile
           {
             ascore = symbols.nextToken();
 
-            Float score = new Float(ascore);
+            Float score = Float.valueOf(ascore);
             scores.addElement(score);
           }
 
@@ -236,7 +240,7 @@ public class JPredFile extends AlignFile
       }
       else if (id.equals("jnetconf"))
       {
-        // log.debug System.out.println("here");
+        // log.debug jalview.bin.Console.outPrintln("here");
         id = "Prediction Confidence";
         this.conf = new Vector(numSymbols);
 
@@ -283,7 +287,7 @@ public class JPredFile extends AlignFile
 
           seq_entries.addElement(newseq.toString());
           ids.addElement(id);
-          Symscores.put(id, new Integer(ids.size() - 1));
+          Symscores.put(id, Integer.valueOf(ids.size() - 1));
         }
       }
     }
@@ -361,10 +365,9 @@ public class JPredFile extends AlignFile
   }
 
   /**
-   * DOCUMENT ME!
    * 
    * @param args
-   *          DOCUMENT ME!
+   * @j2sIgnore
    */
   public static void main(String[] args)
   {
@@ -374,14 +377,14 @@ public class JPredFile extends AlignFile
 
       for (int i = 0; i < jpred.seqs.size(); i++)
       {
-        System.out.println(((Sequence) jpred.seqs.elementAt(i)).getName()
+        jalview.bin.Console.outPrintln(((Sequence) jpred.seqs.elementAt(i)).getName()
                 + "\n"
                 + ((Sequence) jpred.seqs.elementAt(i)).getSequenceAsString()
                 + "\n");
       }
     } catch (java.io.IOException e)
     {
-      System.err.println("Exception " + e);
+      jalview.bin.Console.errPrintln("Exception " + e);
       // e.printStackTrace(); not java 1.1 compatible!
     }
   }
@@ -408,7 +411,7 @@ public class JPredFile extends AlignFile
     // check that no stray annotations have been added at the end.
     {
       SequenceI sq = seqs.elementAt(j - 1);
-      if (sq.getName().toUpperCase().startsWith("JPRED"))
+      if (sq.getName().toUpperCase(Locale.ROOT).startsWith("JPRED"))
       {
         annotSeqs.addElement(sq);
         seqs.removeElementAt(--j);
@@ -444,6 +447,6 @@ public class JPredFile extends AlignFile
  * out = BLCFile.print(s);
  * 
  * AlignFrame af = new AlignFrame(null, s); af.resize(700, 500); af.show();
- * System.out.println(out); } catch (java.io.IOException e) {
- * System.out.println("Exception " + e); } } }
+ * jalview.bin.Console.outPrintln(out); } catch (java.io.IOException e) {
+ * jalview.bin.Console.outPrintln("Exception " + e); } } }
  */