Package org.biojava.bio.seq.impl
Class TemplateUtils
java.lang.Object
org.biojava.bio.seq.impl.TemplateUtils
Common things you may want to do with feature templates.
- Since:
- 1.4
- Author:
- Matthew Pocock
-
Method Summary
Modifier and TypeMethodDescriptionstatic Feature.Template
instantiateTemplate
(Feature feat) This attempts to divine the 'best' template class for a feature and return a new instance readly for pupulating.static Feature.Template
makeTemplate
(Feature feat) static void
populate
(Feature.Template templ, Feature feat) This attempts to populate the fields of a template using the publically accessible information in a feature.
-
Method Details
-
instantiateTemplate
This attempts to divine the 'best' template class for a feature and return a new instance readly for pupulating.This will (hopefully) be the most derived feature interface implemented by a feature class. This code assumes that feature interfaces are singly inherited. Of course, with the current template system, it is a fairly safe assumption.
- Throws:
BioException
-
populate
This attempts to populate the fields of a template using the publically accessible information in a feature. It is simple to call populate() within Feature.makeTemplate() to ensure all the slots get filled.- Parameters:
templ
- the Feature.Template instance to populatefeat
- the Feature to read info from- Throws:
BioException
-
makeTemplate
- Throws:
BioException
-