Merge branch 'releases/Release_2_11_3_Branch'
[jalview.git] / feature / SegmentComparator.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.Comparator;
27
28 public class SegmentComparator implements Comparator {
29
30         public int compare(Object arg0, Object arg1) {
31                 
32                 Segment s1 = (Segment) arg0;
33                 Segment s2 = (Segment) arg1;
34                 
35                 if (s1.getStart() < s2.getStart())
36                         return -1;
37                 if (s1.getStart() > s2.getStart())
38                         return 1;               
39                 
40                 return 0;
41         }
42
43 }