/** * Iterate over the values in the map * * @param consumer to apply to each value in the map */ public void forEach(final Consumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { consumer.accept(entry.getValue()); } }
/** * Iterate over the entries of the map * * @param consumer to apply to each entry in the map */ public void forEach(final EntryConsumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { Long compoundKey = entry.getKey(); final int keyPartA = (int) (compoundKey >>> Integer.SIZE); final int keyPartB = (int) (compoundKey & LOWER_INT_MASK); consumer.accept(keyPartA, keyPartB, entry.getValue()); } }
/** * Iterate over the values in the map * * @param consumer to apply to each value in the map */ public void forEach(final Consumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { consumer.accept(entry.getValue()); } }
public String toString() { final StringBuilder sb = new StringBuilder(); sb.append('{'); for (final Entry<Long, V> entry : entrySet()) { sb.append(entry.getKey().longValue()); sb.append('='); sb.append(entry.getValue()); sb.append(", "); } if (sb.length() > 1) { sb.setLength(sb.length() - 2); } sb.append('}'); return sb.toString(); }
public String toString() { final StringBuilder sb = new StringBuilder(); sb.append('{'); for (final Entry<Long, V> entry : entrySet()) { sb.append(entry.getKey().longValue()); sb.append('='); sb.append(entry.getValue()); sb.append(", "); } if (sb.length() > 1) { sb.setLength(sb.length() - 2); } sb.append('}'); return sb.toString(); }
/** * Iterate over the entries of the map * * @param consumer to apply to each entry in the map */ public void forEach(final EntryConsumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { Long compoundKey = entry.getKey(); final int keyPartA = (int) (compoundKey >>> Integer.SIZE); final int keyPartB = (int) (compoundKey & LOWER_INT_MASK); consumer.accept(keyPartA, keyPartB, entry.getValue()); } }