/****************************************************************************** String Not Equal Ignore Case Comparator ---------------------------------------------------- Copyright (c) Gunnar Gotshalks. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for NON-COMMERCIAL purposes and without fee is hereby granted. *******************************************************************************/ package FlexOr.container; /** Compare two strings ignoring case.
@author Gunnar Gotshalks @see java.util.Vector @version 1.0 1999 Jan 15 */ public class StringNotEqualIC implements BinaryPredicate { /** Return true if string a not = string b, else return false. @exception if at least one of a or b is not a String. */ public final boolean execute(final Object a, final Object b) { if (! (a instanceof String && b instanceof String)) { throw new BinPredParamException(); } return !((String) a).equalsIgnoreCase((String) b); } public static boolean execute(final String a, final String b) { BinaryPredicate comp = new StringNotEqual(); return comp.execute(a, b); } }