/** * Mark a non-binary-compatible instance dirty. Delegate to all * registered StateInterrogation instances until one of them * handles the call. * @param pc the instance to mark dirty * @param fieldName the field to mark dirty */ public void nonBinaryCompatibleMakeDirty(Object pc, String fieldName) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); try { if (si.makeDirty(pc, fieldName)) return; } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } } }
/** * Mark a non-binary-compatible instance dirty. Delegate to all * registered StateInterrogation instances until one of them * handles the call. * @param pc the instance to mark dirty * @param fieldName the field to mark dirty */ public void nonBinaryCompatibleMakeDirty(Object pc, String fieldName) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); try { if (si.makeDirty(pc, fieldName)) return; } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } } }
/** * 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; }
/** * Determine the state of a non-binary-compatible instance. * Delegate to all registered StateInterrogation instances until * one of them handles the call (returns a non-null Boolean * with the answer). * The caller provides the stateless "method object" that does * the actual call to the StateInterrogation instance. * @param pc the instance to be checked * @param sibr the method object that delegates to the * non-binary-compatible implementation * @return Boolean.TRUE if the instance satisfies the state interrogation; * Boolean.FALSE if the instance does not satisfy the interrogation; * or null if the implementation does not manage the class of the instance */ public boolean nonBinaryCompatibleIs(Object pc, StateInterrogationBooleanReturn sibr) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); Boolean result; try { result = sibr.is(pc, si); } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } if (result != null) return result.booleanValue(); } return false; }
/** * 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; }
/** * Determine the state of a non-binary-compatible instance. * Delegate to all registered StateInterrogation instances until * one of them handles the call (returns a non-null Boolean * with the answer). * The caller provides the stateless "method object" that does * the actual call to the StateInterrogation instance. * @param pc the instance to be checked * @param sibr the method object that delegates to the * non-binary-compatible implementation * @return Boolean.TRUE if the instance satisfies the state interrogation; * Boolean.FALSE if the instance does not satisfy the interrogation; * or null if the implementation does not manage the class of the instance */ public boolean nonBinaryCompatibleIs(Object pc, StateInterrogationBooleanReturn sibr) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); Boolean result; try { result = sibr.is(pc, si); } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } if (result != null) return result.booleanValue(); } return false; }