/** * Applies a procedure to each (key,value) pair of the receiver, if any. * Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(IntProcedure)}. * * @param procedure the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise continues. * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. */ public boolean forEachPair(final IntObjectProcedure procedure) { for (int i = table.length ; i-- > 0 ;) { if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false; } return true; } /**
/** * Applies a procedure to each (key,value) pair of the receiver, if any. * Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(IntProcedure)}. * * @param procedure the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise continues. * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. */ public boolean forEachPair(final IntObjectProcedure procedure) { for (int i = table.length ; i-- > 0 ;) { if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false; } return true; } /**
/** * Applies a procedure to each (key,value) pair of the receiver, if any. Iteration order is guaranteed to be <i>identical</i> to * the order used by method {@link #forEachKey(IntProcedure)}. * * @param procedure * the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise continues. * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. */ public boolean forEachPair(final IntObjectProcedure<T> procedure) { for (int i = table.length; i-- > 0;) { if (state[i] == FULL) if (!procedure.apply(table[i], values[i])) return false; } return true; }
public boolean apply(int key) { return procedure.apply(key,get(key)); } }
public boolean apply(int key) { return procedure.apply(key,get(key)); } }
public boolean apply(int key) { return procedure.apply(key, get(key)); } });
public boolean apply(int key, Object value) { if (condition.apply(key,value)) { keyList.add(key); valueList.add(value); } return true; } }
public boolean apply(int key, Object value) { if (condition.apply(key,value)) { keyList.add(key); valueList.add(value); } return true; } }
public boolean apply(int key, Object value) { if (condition.apply(key, value)) { keyList.add(key); valueList.add(value); } return true; } });
if (state[i]==FULL && condition.apply(table[i],values[i])) { keyList.add(table[i]); valueList.add(values[i]);
if (state[i]==FULL && condition.apply(table[i],values[i])) { keyList.add(table[i]); valueList.add(values[i]);
if (state[i] == FULL && condition.apply(table[i], values[i])) { keyList.add(table[i]); valueList.add(values[i]);