X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Futil%2FComparison.java;h=1326647f26e737edb5d63f7f635486e38c51b998;hb=a8362b85de4f21440433bc9385bd9b3a24354532;hp=0beb45bcefca1ad9319236dac9d93bd18af68636;hpb=37de9310bec3501cbc6381e0c3dcb282fcaad812;p=jalview.git diff --git a/src/jalview/util/Comparison.java b/src/jalview/util/Comparison.java index 0beb45b..1326647 100644 --- a/src/jalview/util/Comparison.java +++ b/src/jalview/util/Comparison.java @@ -415,4 +415,29 @@ public class Comparison .size()]); return isNucleotide(oneDArray); } + + /** + * Compares two residues either case sensitively or case insensitively + * depending on the caseSensitive flag + * + * @param c1 + * first char + * @param c2 + * second char to compare with + * @param caseSensitive + * if true comparison will be case sensitive otherwise its not + * @return + */ + public static boolean isSameResidue(char c1, char c2, + boolean caseSensitive) + { + if (caseSensitive) + { + return (c1 == c2); + } + else + { + return Character.toUpperCase(c1) == Character.toUpperCase(c2); + } + } }