public static boolean filterEquals(ClassFilter[] filters1, ClassFilter[] filters2) { if (filters1.length != filters2.length) { return false; } final Set<ClassFilter> f1 = new HashSet<ClassFilter>(Math.max((int) (filters1.length / .75f) + 1, 16)); final Set<ClassFilter> f2 = new HashSet<ClassFilter>(Math.max((int) (filters2.length / .75f) + 1, 16)); Collections.addAll(f1, filters1); Collections.addAll(f2, filters2); return f2.equals(f1); }
public static boolean filterEquals(ClassFilter[] filters1, ClassFilter[] filters2) { if (filters1.length != filters2.length) { return false; } final Set<ClassFilter> f1 = new HashSet<ClassFilter>(Math.max((int) (filters1.length / .75f) + 1, 16)); final Set<ClassFilter> f2 = new HashSet<ClassFilter>(Math.max((int) (filters2.length / .75f) + 1, 16)); for (ClassFilter filter : filters1) { f1.add(filter); } for (ClassFilter aFilters2 : filters2) { f2.add(aFilters2); } return f2.equals(f1); }
@SuppressWarnings({"HardCodedStringLiteral"}) public static boolean isCharOrIntegerArray(Value value) { if (value == null) return false; if (myCharOrIntegers == null) { myCharOrIntegers = new HashSet<String>(); myCharOrIntegers.add("C"); myCharOrIntegers.add("B"); myCharOrIntegers.add("S"); myCharOrIntegers.add("I"); myCharOrIntegers.add("J"); } String signature = value.type().signature(); int i; for (i = 0; signature.charAt(i) == '['; i++) ; if (i == 0) return false; signature = signature.substring(i, signature.length()); return myCharOrIntegers.contains(signature); }