[Biojava-l] SimpleSymbolList changes

Thomas Down td2@sanger.ac.uk
Sun, 2 Jul 2000 18:35:15 +0100


Since the Lurking Horrible ArrayList Bug was blocking me,
I decided to get on and rewrite SimpleSymbolList.  I hope
the changes don't step on anyone's toes -- feel free to
back this out (or ask me to do it) if there's a problem.

For 99.9% of applications, there should be no noticable
change at all (other than the new implementation being
smaller, and maybe a fraction faster ;).  What has changed
is:

  - the constructor SimpleSymbolList(Alphabet, List) now
    validates the Symbols in the supplied list, and can
    consequently throw an IllegalSymbolException.  This
    has a number of (minor) internal knock-on changes,
    but I doubt it will affect end user code.  At most,
    just add an extra try block.

  - I'd like to make SimpleSymbolLists immutable.
    Currently, there is a single mutator method
    (addSymbol), which I have implemented, but also
    deprecated.  I'd rather see SimpleSymbolList
    become immutable, and write a new SymbolList
    implementation with a richer set of mutator methods.
    But for now, no code is affected.

I've also rewritten SimpleSequence to act as a viewer on an
existing SymbolList, rather than copying it, but I haven't
checked this in yet.  Will do next week, if everyone is happy.

Thomas.
-- 
He looked up with big brown eyes.  ``They're really only
tiny little A-bombs, honest.''
                                     -- David Brin.