/** A method that defines matching between Item and Template. * @param t template providing the criteria * @param item the item to match * @param deepCheck true if type of the pair should be tested, false if it is already has been tested * @return true if item matches the template requirements, false if not */ static boolean matches(Template<?> t, Pair<?> item, boolean deepCheck) { String id = t.getId(); if (id != null && !id.equals(item.getId())) { return false; } Object instance = t.getInstance(); if ((instance != null) && !item.creatorOf(instance)) { return false; } if (deepCheck) { return item.instanceOf(t.getType()); } else { return true; } }
out.print(p.getIndex()); out.print(" I: " + p.getInstance());
AbstractLookup.Pair it = (AbstractLookup.Pair) en.nextElement(); if (it.instanceOf(clazz)) {
while (en.hasMoreElements ()) { AbstractLookup.Pair it = (AbstractLookup.Pair)en.nextElement (); if (it.instanceOf (clazz)) {
AbstractLookup.Pair it = (AbstractLookup.Pair) en.nextElement(); if (it.instanceOf(clazz)) {
while (en.hasMoreElements ()) { AbstractLookup.Pair it = (AbstractLookup.Pair)en.nextElement (); if (it.instanceOf (clazz)) {
Class<?> iface = entry.getKey(); if (item.instanceOf(iface)) { Object value = entry.getValue();