Hi -
As this is the second time this has come up, Keith, can I put your solution on Biojava
in Anger?
- Mark
-----Original Message-----
From: Keith James [mailto:[EMAIL PROTECTED]
Sent: Thu 19/06/2003 9:33 p.m.
To: Ren, Zhen
Cc: [EMAIL PROTECTED]
Subject: Re: [Biojava-l] Remove features from a sequence
>>>>> "Zhen" == Ren, Zhen <[EMAIL PROTECTED]> writes:
Zhen> Hi, folks, How do I remove features from a sequence? The
Zhen> interface FeatureHolder has a public method - public void
Zhen> removeFeature(Feature f) throws ChangeVetoException. It is
Zhen> also the superinterface for Sequence. However, I can not
Zhen> use the method (compile error) as shown in the following
Zhen> snippet. Please help. Thanks.
[...]
Hi,
This will not compile because you have a typo at line 23: the method
should be (as seq is a Sequence)
seq.removeFeature(feature)
and not
seq.remove(feature)
Note that when the typo is corrected the program will throw a
java.util.ConcurrentModificationException as written because you are
violating the Java Iterator contract. See the archive for messages
from Mark and myself (in reply to Robert Stones) describing how to
avoid this.
hth, Keith
--
- Keith James <[EMAIL PROTECTED]> bioinformatics programming support -
- Pathogen Sequencing Unit, The Wellcome Trust Sanger Institute, UK -
_______________________________________________
Biojava-l mailing list - [EMAIL PROTECTED]
http://biojava.org/mailman/listinfo/biojava-l
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================
_______________________________________________
Biojava-l mailing list - [EMAIL PROTECTED]
http://biojava.org/mailman/listinfo/biojava-l