org.biojava.bio.seq
Class Feature.Template
java.lang.Object
org.biojava.bio.seq.Feature.Template
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- StrandedFeature.Template
- Enclosing class:
- Feature
- public static class Feature.Template
- extends java.lang.Object
- implements java.io.Serializable
Template class for a plain feature.
This just has fields for representing the properties of a basic Feature. Each
sub-interface should provide a template class that inherits off this, and
the constructor or factory methods should make a particular feature
implementation from the template.
The equals(), hashcode(), toString() and populate() methods are defined
such that two templates are equal if all their fields are equal. These
are implemented by reflection, and automatically pick up any extra fields
added in subclasses.
- Author:
- Thomas Down, Matthew Pocock
- See Also:
- Serialized Form
Method Summary |
boolean |
equals(java.lang.Object b)
|
int |
hashCode()
|
void |
populate(Feature feat)
This attempts to populate the fields of this template using
the publically accessible information in a feature. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
location
public Location location
type
public java.lang.String type
source
public java.lang.String source
annotation
public Annotation annotation
Feature.Template
public Feature.Template()
hashCode
public int hashCode()
equals
public boolean equals(java.lang.Object b)
populate
public void populate(Feature feat)
throws BioException
- This attempts to populate the fields of this 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:
feat
- the Feature to read info from
- Throws:
BioException
toString
public java.lang.String toString()