licencing and format applied (eclipse)
[jalview.git] / src / jalview / io / NewickFile.java
index 7dd98c0..8dc2389 100755 (executable)
@@ -83,12 +83,12 @@ public class NewickFile extends FileParse
 
   private com.stevesoft.pat.Regex[] NodeSafeName = new com.stevesoft.pat.Regex[]
   { new com.stevesoft.pat.Regex().perlCode("m/[\\[,:'()]/"), // test for
-                                                              // requiring
-                                                              // quotes
+      // requiring
+      // quotes
       new com.stevesoft.pat.Regex().perlCode("s/'/''/"), // escaping quote
-                                                          // characters
+      // characters
       new com.stevesoft.pat.Regex().perlCode("s/\\/w/_/") // unqoted whitespace
-                                                          // transformation
+  // transformation
   };
 
   char QuoteChar = '\'';
@@ -279,14 +279,14 @@ public class NewickFile extends FileParse
     String commentString2 = null; // comments after simple node props
 
     float DefDistance = (float) 0.001; // @param Default distance for a node -
-                                        // very very small
+    // very very small
     int DefBootstrap = -1; // @param Default bootstrap for a node
 
     float distance = DefDistance;
     int bootstrap = DefBootstrap;
 
     boolean ascending = false; // flag indicating that we are leaving the
-                                // current node
+    // current node
 
     com.stevesoft.pat.Regex majorsyms = new com.stevesoft.pat.Regex(
             "[(\\['),;]");
@@ -429,7 +429,7 @@ public class NewickFile extends FileParse
         if (uqnodename.search(fstring)
                 && ((uqnodename.matchedFrom(1) == 0) || (fstring
                         .charAt(uqnodename.matchedFrom(1) - 1) != ':'))) // JBPNote
-                                                                          // HACK!
+        // HACK!
         {
           if (nodename == null)
           {
@@ -505,8 +505,8 @@ public class NewickFile extends FileParse
           if (c == realroot)
           {
             RootHasDistance = nodehasdistance; // JBPNote This is really
-                                                // UGLY!!! Ensure root node gets
-                                                // its given distance
+            // UGLY!!! Ensure root node gets
+            // its given distance
           }
           parseNHXNodeProps(c, commentString2);
           commentString2 = null;
@@ -584,7 +584,7 @@ public class NewickFile extends FileParse
         nodename = null;
         distance = DefDistance;
         bootstrap = DefBootstrap;
-        commentString2=null;
+        commentString2 = null;
       }
       if (nextcp == 0)
       {
@@ -629,39 +629,40 @@ public class NewickFile extends FileParse
     // tree is output
     if (commentString != null && commentString.startsWith("&&NHX"))
     {
-      StringTokenizer st = new StringTokenizer(commentString.substring(5),":");
+      StringTokenizer st = new StringTokenizer(commentString.substring(5),
+              ":");
       while (st.hasMoreTokens())
       {
         String tok = st.nextToken();
-        int colpos=tok.indexOf("=");
+        int colpos = tok.indexOf("=");
 
-        if (colpos>-1)
+        if (colpos > -1)
         {
           String code = tok.substring(0, colpos);
-          String value = tok.substring(colpos+1);
-          try {
+          String value = tok.substring(colpos + 1);
+          try
+          {
             // parse out code/value pairs
             if (code.toLowerCase().equals("b"))
             {
-              int v=-1;
+              int v = -1;
               Float iv = new Float(value);
               v = iv.intValue(); // jalview only does integer bootstraps
-                                  // currently
+              // currently
               c.setBootstrap(v);
               HasBootstrap = true;
             }
             // more codes here.
-          }
-          catch (Exception e)
+          } catch (Exception e)
           {
-            System.err.println("Couldn't parse code '"+code+"' = '"+value+"'");
+            System.err.println("Couldn't parse code '" + code + "' = '"
+                    + value + "'");
             e.printStackTrace(System.err);
           }
         }
       }
     }
-        
-      
+
   }
 
   /**