[Biojava-l] Extending Feature?

pootle monster pootle_monster@hotmail.com
Tue, 05 Mar 2002 10:32:35 +0000


I to create a new Feature Object

I have extended the Feature interface, in the same way as StrandedFeature 
does (but with my own methods instead)

This works fine and I can create a template :

MyFeatureType.Template template = new MyFeatureType.Template();
template.type = "MyFeature";
template.source = source;
template.location = new RangeLocation(start, end);
template.annotation = Annotation.EMPTY_ANNOTATION;
template.myValue = 12345;

Which I can then add to the sequence FeatureHolder using:

sequence.createFeature(template);


The problem is that when I then use an itreator:

Iterator myIterator = sequence.features();

I get a SimpleFeature cast exception when trying to cast the feature to 
MyFeatureType.






_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.