X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fbiojava%2Fdasobert%2Ffeature%2FFeatureMapComparator.java;h=aa38981ab7f43aad0f6bdf03149042639ea97cc5;hb=0c0991e85ba4c0536b366abe020eaf84ca6e29a4;hp=8aa747b7f6d910189e5df560178e608e02286c3c;hpb=54e003f9b2fff47dbfea6401c3944afdb7bd37b3;p=jalview.git diff --git a/src/org/biojava/dasobert/feature/FeatureMapComparator.java b/src/org/biojava/dasobert/feature/FeatureMapComparator.java index 8aa747b..aa38981 100644 --- a/src/org/biojava/dasobert/feature/FeatureMapComparator.java +++ b/src/org/biojava/dasobert/feature/FeatureMapComparator.java @@ -22,48 +22,47 @@ * */ +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; + } }