From: jprocter Date: Mon, 30 Apr 2007 13:22:25 +0000 (+0000) Subject: alignment properties and embedded newick strings can be retrieved from parsed files X-Git-Tag: Release_2_3~111 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=399e0a89825912b53a2cc26f069451e899fb7963;p=jalview.git alignment properties and embedded newick strings can be retrieved from parsed files --- diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index 3c7e0b2..c9a383f 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -129,12 +129,22 @@ public abstract class AlignFile } } } + /** + * Store a non-null key-value pair in a hashtable used to set alignment properties + * note: null keys will raise an error, null values will result in the key/value pair being silently ignored. + * @param key - non-null key object + * @param value - non-null value + */ protected void setAlignmentProperty(Object key, Object value) { if (key==null) { throw new Error("Implementation error: Cannot have null alignment property key."); } + if (value==null) + { + return; // null properties are ignored. + } if (properties==null) { properties = new Hashtable(); @@ -223,5 +233,27 @@ public abstract class AlignFile { return seq.getDisplayId(jvSuffix); } + /** + * vector of String[] treeName, newickString pairs + */ + Vector newickStrings=null; + + protected void addNewickTree(String treeName, String newickString) + { + if (newickStrings == null) + { + newickStrings = new Vector(); + } + newickStrings.add(new String[] { treeName, newickString}); + } + + protected int getTreeCount() + { + if (newickStrings==null) + { + return 0; + } + return newickStrings.size(); + } }