/** * Returns <tt>true</tt> if the receiver contains the specified key. * * @return <tt>true</tt> if the receiver contains the specified key. */ public boolean containsKey(final short key) { return !forEachKey( new ShortProcedure() { @Override public boolean apply(short iterKey) { return key != iterKey; } } ); }
/** * 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(ShortProcedure)}. * * @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 ShortFloatProcedure procedure) { return forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { return procedure.apply(key, get(key)); } } ); }
/** * Fills all keys contained in the receiver into the specified list. Fills the list, starting at index 0. After this * call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to * be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}. <p> This method can be used to * iterate over the keys of the receiver. * * @param list the list to be filled, can have any size. */ public void keys(final ShortArrayList list) { list.clear(); forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { list.add(key); return true; } } ); }
/** * Fills all values contained in the receiver into the specified list. Fills the list, starting at index 0. After this * call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to * be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}. * <p> This method can be used to * iterate over the values of the receiver. * * @param list the list to be filled, can have any size. */ public void values(final FloatArrayList list) { list.clear(); forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { list.add(get(key)); return true; } } ); }
/** * Returns <tt>true</tt> if the receiver contains the specified key. * * @return <tt>true</tt> if the receiver contains the specified key. */ public boolean containsKey(final short key) { return !forEachKey( new ShortProcedure() { @Override public boolean apply(short iterKey) { return key != iterKey; } } ); }
/** * Returns <tt>true</tt> if the receiver contains the specified key. * * @return <tt>true</tt> if the receiver contains the specified key. */ public boolean containsKey(final short key) { return !forEachKey( new ShortProcedure() { @Override public boolean apply(short iterKey) { return (key != iterKey); } } ); }
/** * 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(ShortProcedure)}. * * @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 ShortFloatProcedure procedure) { return forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { return procedure.apply(key, get(key)); } } ); }
/** * 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(ShortProcedure)}. * * @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 ShortFloatProcedure procedure) { return forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { return procedure.apply(key, get(key)); } } ); }
/** * Fills all keys contained in the receiver into the specified list. Fills the list, starting at index 0. After this * call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to * be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}. <p> This method can be used to * iterate over the keys of the receiver. * * @param list the list to be filled, can have any size. */ public void keys(final ShortArrayList list) { list.clear(); forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { list.add(key); return true; } } ); }
/** * Fills all keys contained in the receiver into the specified list. Fills the list, starting at index 0. After this * call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to * be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}. <p> This method can be used to * iterate over the keys of the receiver. * * @param list the list to be filled, can have any size. */ public void keys(final ShortArrayList list) { list.clear(); forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { list.add(key); return true; } } ); }
/** * Fills all values contained in the receiver into the specified list. Fills the list, starting at index 0. After this * call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to * be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}. * <p> This method can be used to * iterate over the values of the receiver. * * @param list the list to be filled, can have any size. */ public void values(final FloatArrayList list) { list.clear(); forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { list.add(get(key)); return true; } } ); }
/** * Fills all values contained in the receiver into the specified list. Fills the list, starting at index 0. After this * call returns the specified list has a new size that equals <tt>this.size()</tt>. Iteration order is guaranteed to * be <i>identical</i> to the order used by method {@link #forEachKey(ShortProcedure)}. * <p> This method can be used to * iterate over the values of the receiver. * * @param list the list to be filled, can have any size. */ public void values(final FloatArrayList list) { list.clear(); forEachKey( new ShortProcedure() { @Override public boolean apply(short key) { list.add(get(key)); return true; } } ); }