/** * Return an object associated with a non-binary-compatible instance. * Delegate to all registered StateInterrogation instances until * one of them handles the call (returns a non-null answer). * The caller provides the stateless "method object" that does * the actual call to the StateInterrogation instance. * @param pc the instance whose associated object is needed * @param sibr the method object that delegates to the * non-binary-compatible implementation * @return the associated object or null if the implementation does not * manage the class of the instance */ public Object nonBinaryCompatibleGet(Object pc, StateInterrogationObjectReturn sibr) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); Object result; try { result = sibr.get(pc, si); } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } if (result != null) return result; } return null; }
/** * Return an object associated with a non-binary-compatible instance. * Delegate to all registered StateInterrogation instances until * one of them handles the call (returns a non-null answer). * The caller provides the stateless "method object" that does * the actual call to the StateInterrogation instance. * @param pc the instance whose associated object is needed * @param sibr the method object that delegates to the * non-binary-compatible implementation * @return the associated object or null if the implementation does not * manage the class of the instance */ public Object nonBinaryCompatibleGet(Object pc, StateInterrogationObjectReturn sibr) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); Object result; try { result = sibr.get(pc, si); } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } if (result != null) return result; } return null; }