merge from 2_4_Release branch
[jalview.git] / src / org / biojava / dasobert / feature / HistogramFeature.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 May 22, 2007
21  * 
22  */
23
24 package org.biojava.dasobert.feature;
25
26 import java.util.Iterator;
27
28 /**
29  * a class that represents Histogram Style features in addition to normal
30  * features they know about Max and Minimum scores for the whole line Histogram
31  * feautes have only one (Histogram) Segment, which contains the scores for each
32  * position
33  * 
34  * @author Andreas Prlic
35  * 
36  */
37 public class HistogramFeature extends AbstractFeatureTrack
38 {
39
40   double max;
41
42   double min;
43
44   public HistogramFeature()
45   {
46     super();
47     // TODO Auto-generated constructor stub
48   }
49
50   public double getMax()
51   {
52     return max;
53   }
54
55   public void setMax(double max)
56   {
57     this.max = max;
58   }
59
60   public double getMin()
61   {
62     return min;
63   }
64
65   public void setMin(double min)
66   {
67     this.min = min;
68   }
69
70   public Object clone()
71   {
72
73     HistogramFeature f = new HistogramFeature();
74
75     f.setName(name);
76     f.setMethod(method);
77     f.setType(type);
78     f.setNote(note);
79     f.setLink(link);
80     f.setSource(source);
81     f.setScore(score);
82
83     Iterator iter = segments.iterator();
84
85     while (iter.hasNext())
86     {
87       Segment s = (Segment) iter.next();
88       f.addSegment((Segment) s.clone());
89     }
90
91     return f;
92
93   }
94
95 }