X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAlignFile.java;h=2ad32f0787e97f9ea99e2ca342503440a2061880;hb=a8d30fa38a5d3e9cccf08aa446ca8ab00469bfd4;hp=3c7e0b263e4ff805cf5b384c4a4c5da7809e2652;hpb=8630b85f5394dfbc86a6c3c22ec17ffcc6ed1ea1;p=jalview.git diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index 3c7e0b2..2ad32f0 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -71,7 +71,17 @@ public abstract class AlignFile parse(); } - + /** + * Attempt to read from the position where some other parsing process left off. + * @param source + * @throws IOException + */ + public AlignFile(FileParse source) throws IOException + { + super(source); + initData(); + parse(); + } /** * Return the seqs Vector */ @@ -129,12 +139,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 +243,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.addElement(new String[] { treeName, newickString}); + } + + protected int getTreeCount() + { + if (newickStrings==null) + { + return 0; + } + return newickStrings.size(); + } }