JAL-1807 explicit imports (jalview.io.*)
[jalview.git] / src / jalview / io / NewickFile.java
index 92456d5..90f7faf 100755 (executable)
 // TODO: Extended SequenceNodeI to hold parsed NHX strings
 package jalview.io;
 
-import java.io.*;
+import jalview.datamodel.SequenceNode;
+import jalview.util.MessageManager;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
 import java.util.StringTokenizer;
 
-import jalview.datamodel.*;
-import jalview.util.MessageManager;
+import com.stevesoft.pat.Regex;
 
 /**
  * Parse a new hanpshire style tree Caveats: NHX files are NOT supported and the
@@ -84,13 +89,13 @@ public class NewickFile extends FileParse
 
   boolean printRootInfo = true;
 
-  private com.stevesoft.pat.Regex[] NodeSafeName = new com.stevesoft.pat.Regex[]
-  { new com.stevesoft.pat.Regex().perlCode("m/[\\[,:'()]/"), // test for
+  private Regex[] NodeSafeName = new Regex[]
+  { new Regex().perlCode("m/[\\[,:'()]/"), // test for
       // requiring
       // quotes
-      new com.stevesoft.pat.Regex().perlCode("s/'/''/"), // escaping quote
+      new Regex().perlCode("s/'/''/"), // escaping quote
       // characters
-      new com.stevesoft.pat.Regex().perlCode("s/\\/w/_/") // unqoted whitespace
+      new Regex().perlCode("s/\\/w/_/") // unqoted whitespace
   // transformation
   };
 
@@ -291,7 +296,7 @@ public class NewickFile extends FileParse
     boolean ascending = false; // flag indicating that we are leaving the
     // current node
 
-    com.stevesoft.pat.Regex majorsyms = new com.stevesoft.pat.Regex(
+    Regex majorsyms = new Regex(
             "[(\\['),;]");
 
     int nextcp = 0;
@@ -353,7 +358,7 @@ public class NewickFile extends FileParse
       // Deal with quoted fields
       case '\'':
 
-        com.stevesoft.pat.Regex qnodename = new com.stevesoft.pat.Regex(
+        Regex qnodename = new Regex(
                 "'([^']|'')+'");
 
         if (qnodename.searchFrom(nf, fcp))
@@ -362,7 +367,7 @@ public class NewickFile extends FileParse
           nodename = new String(qnodename.stringMatched().substring(1,
                   nl - 1));
           // unpack any escaped colons
-          com.stevesoft.pat.Regex xpandquotes = com.stevesoft.pat.Regex
+          Regex xpandquotes = Regex
                   .perlCode("s/''/'/");
           String widernodename = xpandquotes.replaceAll(nodename);
           nodename = widernodename;
@@ -397,7 +402,7 @@ public class NewickFile extends FileParse
            * '"+nf.substring(cp,fcp)+"'"); }
            */
           // verify termination.
-          com.stevesoft.pat.Regex comment = new com.stevesoft.pat.Regex("]");
+          Regex comment = new Regex("]");
           if (comment.searchFrom(nf, fcp))
           {
             // Skip the comment field
@@ -430,11 +435,11 @@ public class NewickFile extends FileParse
                   + fstring.substring(cend + 1);
 
         }
-        com.stevesoft.pat.Regex uqnodename = new com.stevesoft.pat.Regex(
+        Regex uqnodename = new Regex(
                 "\\b([^' :;\\](),]+)");
-        com.stevesoft.pat.Regex nbootstrap = new com.stevesoft.pat.Regex(
+        Regex nbootstrap = new Regex(
                 "\\s*([0-9+]+)\\s*:");
-        com.stevesoft.pat.Regex ndist = new com.stevesoft.pat.Regex(
+        Regex ndist = new Regex(
                 ":([-0-9Ee.+]+)");
 
         if (!parsednodename
@@ -964,7 +969,7 @@ public class NewickFile extends FileParse
       trf.parse();
       System.out.println("Original file :\n");
 
-      com.stevesoft.pat.Regex nonl = new com.stevesoft.pat.Regex("\n+", "");
+      Regex nonl = new Regex("\n+", "");
       System.out.println(nonl.replaceAll(newickfile.toString()) + "\n");
 
       System.out.println("Parsed file.\n");