2 * BioJava development code
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,
9 * http://www.gnu.org/copyleft/lesser.html
11 * Copyright for this code is held jointly by the individual
12 * authors. These should be listed in @author doc comments.
14 * For more information on the BioJava project and its aims,
15 * or to join the biojava-l mailing list, visit the home page
18 * http://www.biojava.org/
20 * Created on 23.09.2004
21 * @author Andreas Prlic
26 package org.biojava.dasobert.feature ;
28 import java.util.Comparator ;
29 import java.util.Map ;
31 /** a comparator to sort Features if they are still in a Map ( sorts by type )
32 * @author Andreas Prlic
35 public class FeatureMapComparator
39 public FeatureMapComparator() {
42 public int compare(Object a, Object b) {
46 String typea = (String)x.get("TYPE");
47 String typeb = (String)y.get("TYPE");
51 if ( isSecstruc(typea) && isSecstruc(typeb)) {
54 return typea.compareTo(typeb);
57 public boolean isSecstruc(String type) {
58 if ( type.equals("HELIX")