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" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 08/06/2005 12:49 PM To: "Felipe Albrecht" <[EMAIL PROTECTED]>, <biojava-l@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: [EMAIL PROTECTED] on behalf of Felipe Albrecht Sent: Sat 8/6/2005 5:05 AM To: biojava-l@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@biojava.org http://biojava.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l@biojava.org http://biojava.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l@biojava.org http://biojava.org/mailman/listinfo/biojava-l