+ // File IO Flags
+ boolean ReplaceUnderscores = false;
+ boolean printRootInfo = false;
+ private com.stevesoft.pat.Regex[] NodeSafeName = new com.stevesoft.pat.Regex[]
+ {
+ new com.stevesoft.pat.Regex().perlCode("m/[\\[,:'()]/"), // test for requiring quotes
+ new com.stevesoft.pat.Regex().perlCode("s/'/''/"), // escaping quote characters
+ new com.stevesoft.pat.Regex().perlCode("s/\\/w/_/") // unqoted whitespace transformation
+ };
+ char QuoteChar = '\'';
+
+ /**
+ * Creates a new NewickFile object.
+ *
+ * @param inStr DOCUMENT ME!
+ *
+ * @throws IOException DOCUMENT ME!
+ */
+ public NewickFile(String inStr)
+ throws IOException
+ {
+ super(inStr, "Paste");
+ }
+
+ /**
+ * Creates a new NewickFile object.
+ *
+ * @param inFile DOCUMENT ME!
+ * @param type DOCUMENT ME!
+ *
+ * @throws IOException DOCUMENT ME!
+ */
+ public NewickFile(String inFile, String type)
+ throws IOException
+ {
+ super(inFile, type);
+ }
+
+ /**
+ * Creates a new NewickFile object.
+ *
+ * @param newtree DOCUMENT ME!
+ */
+ public NewickFile(SequenceNode newtree)
+ {
+ root = newtree;
+ }
+
+ /**
+ * Creates a new NewickFile object.
+ *
+ * @param newtree DOCUMENT ME!
+ * @param bootstrap DOCUMENT ME!
+ */
+ public NewickFile(SequenceNode newtree, boolean bootstrap)
+ {
+ HasBootstrap = bootstrap;
+ root = newtree;
+ }
+
+ /**
+ * Creates a new NewickFile object.
+ *
+ * @param newtree DOCUMENT ME!
+ * @param bootstrap DOCUMENT ME!
+ * @param distances DOCUMENT ME!
+ */
+ public NewickFile(SequenceNode newtree, boolean bootstrap, boolean distances)
+ {
+ root = newtree;
+ HasBootstrap = bootstrap;
+ HasDistances = distances;
+ }
+
+ /**
+ * Creates a new NewickFile object.
+ *
+ * @param newtree DOCUMENT ME!
+ * @param bootstrap DOCUMENT ME!
+ * @param distances DOCUMENT ME!
+ * @param rootdistance DOCUMENT ME!
+ */
+ public NewickFile(SequenceNode newtree, boolean bootstrap,
+ boolean distances, boolean rootdistance)
+ {
+ root = newtree;
+ HasBootstrap = bootstrap;
+ HasDistances = distances;
+ RootHasDistance = rootdistance;
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param Error DOCUMENT ME!
+ * @param Er DOCUMENT ME!
+ * @param r DOCUMENT ME!
+ * @param p DOCUMENT ME!
+ * @param s DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ private String ErrorStringrange(String Error, String Er, int r, int p,
+ String s)
+ {
+ return ( (Error == null) ? "" : Error) + Er + " at position " + p +
+ " ( " +
+ s.substring( ( (p - r) < 0) ? 0 : (p - r),
+ ( (p + r) > s.length()) ? s.length() : (p + r)) + " )\n";