*
*/
+package org.biojava.dasobert.feature;
-package org.biojava.dasobert.feature ;
+import java.util.Comparator;
+import java.util.Map;
-import java.util.Comparator ;
-import java.util.Map ;
-
-/** a comparator to sort Features if they are still in a Map ( sorts by type )
+/**
+ * a comparator to sort Features if they are still in a Map ( sorts by type )
+ *
* @author Andreas Prlic
*/
-public class FeatureMapComparator
- implements Comparator
+public class FeatureMapComparator implements Comparator
{
- public FeatureMapComparator() {
- }
+ public FeatureMapComparator()
+ {
+ }
- public int compare(Object a, Object b) {
- Map x = (Map) a;
- Map y = (Map) b;
+ public int compare(Object a, Object b)
+ {
+ Map x = (Map) a;
+ Map y = (Map) b;
- String typea = (String)x.get("TYPE");
- String typeb = (String)y.get("TYPE");
-
-
+ String typea = (String) x.get("TYPE");
+ String typeb = (String) y.get("TYPE");
- if ( isSecstruc(typea) && isSecstruc(typeb)) {
- return 0 ;
- }
- return typea.compareTo(typeb);
+ if (isSecstruc(typea) && isSecstruc(typeb))
+ {
+ return 0;
}
+ return typea.compareTo(typeb);
+ }
- public boolean isSecstruc(String type) {
- if ( type.equals("HELIX")
- ||
- type.equals("STRAND")
- ||
- type.equals("TURN")
- ) {
- return true ;
- }
- return false ;
+ public boolean isSecstruc(String type)
+ {
+ if (type.equals("HELIX") || type.equals("STRAND")
+ || type.equals("TURN"))
+ {
+ return true;
}
+ return false;
+ }
}