[Biojava-l] Sequence and String

mark.schreiber at novartis.com mark.schreiber at novartis.com
Tue Aug 9 22:49:17 EDT 2005


Actually a class called a SymbolTokenizer governs the transition from 
Symbols to Strings. The String is assembled in a StringBuffer but 
ultimately a new String is created with each call to seqString().

The method seqString() is really only meant for displaying the sequence in 
a readable way to STDOUT or similar. It shouldn't be used in algorithms or 
general programing.

- Mark





"Richard HOLLAND" <hollandr at gis.a-star.edu.sg>
Sent by: biojava-l-bounces at portal.open-bio.org
08/06/2005 12:49 PM

 
        To:     "Felipe Albrecht" <felipe.albrecht at gmail.com>, <biojava-l at biojava.org>
        cc:     (bcc: Mark Schreiber/GP/Novartis)
        Subject:        RE: [Biojava-l] Sequence and String


Internally the Sequence is stored not as a String but as an array of 
Symbol objects. Hence when you call seqString(), a new String is generated 
every time by appending the results of calling toString() on every Symbol 
object in the internal array.

cheers,
Richard


-----Original Message-----
From:            biojava-l-bounces at portal.open-bio.org on behalf of Felipe 
Albrecht
Sent:            Sat 8/6/2005 5:05 AM
To:              biojava-l at biojava.org
Cc: 
Subject:                 [Biojava-l] Sequence and String
Hello,

When I do "sequence.seqString()" ,  [sequence as a instance of 
SimpleSequence]
I catch a _new_ String representing the sequence or a _reference_ for
the String in my Sequence class?

Its is important for me, because if a have a greate sequence, I will
waste memory copying then when a need take your String representation.


Thanks.


Felipe Albrecht

_______________________________________________
Biojava-l mailing list  -  Biojava-l at biojava.org
http://biojava.org/mailman/listinfo/biojava-l




_______________________________________________
Biojava-l mailing list  -  Biojava-l at biojava.org
http://biojava.org/mailman/listinfo/biojava-l





More information about the Biojava-l mailing list