001    /*
002     * To change this template, choose Tools | Templates
003     * and open the template in the editor.
004     */
005    
006    package org.biojava3.core.sequence.features;
007    
008    import java.util.List;
009    import org.biojava3.core.sequence.location.SequenceLocation;
010    import org.biojava3.core.sequence.template.AbstractSequence;
011    import org.biojava3.core.sequence.template.Compound;
012    
013    /**
014     * Interface class to handle describing arbitrary features. A feature can be found at multiple locations in a sequence such as
015     * the surface of a protein where different sequence positions make up that feature. Ligand binding pocket is another example.
016     * The location in its current form knows the start and stop position in a sequence and thus should contain knowledge about the
017     * actual sequence.
018     *
019     * A feature can contain features to handle cases where a domain is a feature and the secondary structures covered by that domain
020     * and other requirements for grouping.
021     * 
022     * @author Scooter Willis <willishf at gmail dot com>
023     */
024    public interface FeatureInterface<S extends AbstractSequence<C>, C extends Compound> {
025    
026        /**
027         * Get the short description that can be used to describe the feature
028         * @return
029         */
030    
031        public String getShortDescription();
032    
033        /**
034         * Set the short description that can be used to describe the feature
035         * @param shortDescription
036         */
037    
038        public void setShortDescription(String shortDescription);
039    
040          /**
041         * Get the description that can be used to describe the feature
042         * @return
043         */
044    
045        public String getDescription();
046    
047    
048          /**
049         * Set the description that can be used to describe the feature
050         * @return
051         */
052    
053        public void setDescription(String description);
054    
055            /**
056         * The location(s) of this feature where the location should contain a reference to parent and sequence etc.
057         * <p>
058         * The location may be complicated, or simply a range.
059         * The annotation is assumed to apply to all the region contained
060         * within the location.
061         *
062         * @return a Location anchoring this feature
063         */
064        public SequenceLocation<S, C> getLocations();
065    
066            /**
067         * The new location for this feature.
068         * <p>
069         * The location may be complicated or simply a range. The annotation is
070         * assumed to apply to the entire region contained within the location.
071         * Any values returned from methods that rely on the old location must
072         * not be affected.
073         *
074         * @param loc the new Location for this feature
075         *
076         */
077        public void setLocation(SequenceLocation<S, C> loc);
078    
079            /**
080         * The type of the feature.
081         *
082         * @return the type of this sequence
083         */
084        public String getType();
085    
086        /**
087         * Change the type of this feature.
088         *
089         * @param type  new type String
090         *
091         */
092        public void setType(String type);
093    
094    
095            /**
096         * The source of the feature. This may be a program or process.
097         *
098         * @return the source, or generator
099         */
100        public String getSource();
101    
102        /**
103         * Change the source of the FeatureInterface.
104         *
105         * @param source the new source String
106         *
107         */
108        public void setSource(String source);
109    
110        /**
111         * Set the parent feature
112         * @param feature
113         */
114    
115        public void setParentFeature(FeatureInterface<S, C> feature);
116    
117        /**
118         * Get the parent feature
119         * @return
120         */
121    
122        public FeatureInterface<S, C> getParentFeature();
123    
124        /**
125         * Get the features contained by this feature
126         * @return
127         */
128    
129        public List<FeatureInterface<S, C>> getChildrenFeatures();
130    
131        /**
132         * Set the children features
133         * @param features
134         */
135    
136        public void setChildrenFeatures(List<FeatureInterface<S, C>> features);
137    
138    
139            /**
140         * @return the userObject
141         */
142        public Object getUserObject();
143    
144        /**
145         * @param userObject the userObject to set
146         */
147        public void setUserObject(Object userObject);
148    
149    }