78e28406c4682d1750aab3aa02178740b2702ade
[jalview.git] / src / org / biojava / dasobert / feature / Segment.java
1 /*
2  *                    BioJava development code
3  *
4  * This code may be freely distributed and modified under the
5  * terms of the GNU Lesser General Public Licence.  This should
6  * be distributed with the code.  If you do not have a copy,
7  * see:
8  *
9  *      http://www.gnu.org/copyleft/lesser.html
10  *
11  * Copyright for this code is held jointly by the individual
12  * authors.  These should be listed in @author doc comments.
13  *
14  * For more information on the BioJava project and its aims,
15  * or to join the biojava-l mailing list, visit the home page
16  * at:
17  *
18  *      http://www.biojava.org/
19  *
20  * Created on 22.09.2004
21  * @author Andreas Prlic
22  *
23  */
24
25 package org.biojava.dasobert.feature;
26
27 import java.awt.Color;
28
29 /** a class to keep track of location information for a feature */
30 public interface Segment
31 {
32
33   public Object clone();
34
35   public String toString();
36
37   public String getNote();
38
39   public void setNote(String note);
40
41   public void setStart(int strt);
42
43   public int getStart();
44
45   public void setEnd(int ed);
46
47   public int getEnd();
48
49   public void setName(String nam);
50
51   public String getName();
52
53   public void setColor(Color col);
54
55   public Color getColor();
56
57   public void setParent(FeatureTrack f);
58
59   public FeatureTrack getParent();
60
61   public void setTxtColor(String str);
62
63   public String getTxtColor();
64
65   /**
66    * returns true if the specified sequence position is within the range of this
67    * Segment
68    * 
69    * @param seqPosition
70    *                the position to check
71    * @return true if seqPos >= start && seqPos <= end
72    */
73   public boolean overlaps(int seqPosition);
74
75   /**
76    * tests if two segments are overlapping
77    * 
78    * @param segment
79    *                to compare with
80    * @return true if segments overlap
81    */
82   public boolean overlaps(Segment segment);
83
84 }