public Object[] toArrayHelper(int offset) { final int N = colGetSize(); Object[] result = new Object[N]; for (int i=0; i<N; i++) { result[i] = colGetEntry(i, offset); } return result; };
/** * Determine if the array map contains all of the keys in the given collection. * @param collection The collection whose contents are to be checked against. * @return Returns true if this array map contains a key for every entry * in <var>collection</var>, else returns false. */ public boolean containsAll(Collection<?> collection) { return MapCollections.containsAllHelper(this, collection); }
/** * Return a {@link java.util.Set} for iterating over and interacting with all mappings * in the array map. * * <p><b>Note:</b> this is a very inefficient way to access the array contents, it * requires generating a number of temporary objects.</p> * * <p><b>Note:</b></p> the semantics of this * Set are subtly different than that of a {@link java.util.HashMap}: most important, * the {@link java.util.Map.Entry Map.Entry} object returned by its iterator is a single * object that exists for the entire iterator, so you can <b>not</b> hold on to it * after calling {@link java.util.Iterator#next() Iterator.next}.</p> */ @Override public Set<Entry<K, V>> entrySet() { return getCollection().getEntrySet(); }
/** * Return an {@link java.util.Iterator} over all values in the set. * * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it * requires generating a number of temporary objects and allocates additional state * information associated with the container that will remain for the life of the container.</p> */ @Override public Iterator<E> iterator() { return getCollection().getKeySet().iterator(); }
/** * Remove all keys in the array map that exist in the given collection. * @param collection The collection whose contents are to be used to remove keys. * @return Returns true if any keys were removed from the array map, else false. */ public boolean removeAll(Collection<?> collection) { return MapCollections.removeAllHelper(this, collection); }
/** * Remove all keys in the array map that do <b>not</b> exist in the given collection. * @param collection The collection whose contents are to be used to determine which * keys to keep. * @return Returns true if any keys were removed from the array map, else false. */ public boolean retainAll(Collection<?> collection) { return MapCollections.retainAllHelper(this, collection); }
/** * Return a {@link java.util.Collection} for iterating over and interacting with all values * in the array map. * * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it * requires generating a number of temporary objects.</p> */ @Override public Collection<V> values() { return getCollection().getValues(); } }
/** * Return a {@link java.util.Set} for iterating over and interacting with all keys * in the array map. * * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it * requires generating a number of temporary objects.</p> */ @Override public Set<K> keySet() { return getCollection().getKeySet(); }
/** * Remove all keys in the array map that exist in the given collection. * @param collection The collection whose contents are to be used to remove keys. * @return Returns true if any keys were removed from the array map, else false. */ public boolean removeAll(Collection<?> collection) { return MapCollections.removeAllHelper(this, collection); }
/** * Remove all keys in the array map that do <b>not</b> exist in the given collection. * @param collection The collection whose contents are to be used to determine which * keys to keep. * @return Returns true if any keys were removed from the array map, else false. */ public boolean retainAll(Collection<?> collection) { return MapCollections.retainAllHelper(this, collection); }
/** * Return a {@link java.util.Collection} for iterating over and interacting with all values * in the array map. * * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it * requires generating a number of temporary objects.</p> */ @Override public Collection<V> values() { return getCollection().getValues(); } }
public <T> T[] toArrayHelper(T[] array, int offset) { final int N = colGetSize(); if (array.length < N) { @SuppressWarnings("unchecked") T[] newArray = (T[]) Array.newInstance(array.getClass().getComponentType(), N); array = newArray; } for (int i=0; i<N; i++) { array[i] = (T)colGetEntry(i, offset); } if (array.length > N) { array[N] = null; } return array; }
/** * Return an {@link java.util.Iterator} over all values in the set. * * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it * requires generating a number of temporary objects and allocates additional state * information associated with the container that will remain for the life of the container.</p> */ @Override public Iterator<E> iterator() { return getCollection().getKeySet().iterator(); }
/** * Determine if the array map contains all of the keys in the given collection. * @param collection The collection whose contents are to be checked against. * @return Returns true if this array map contains a key for every entry * in <var>collection</var>, else returns false. */ public boolean containsAll(Collection<?> collection) { return MapCollections.containsAllHelper(this, collection); }
/** * Remove all keys in the array map that exist in the given collection. * @param collection The collection whose contents are to be used to remove keys. * @return Returns true if any keys were removed from the array map, else false. */ public boolean removeAll(Collection<?> collection) { return MapCollections.removeAllHelper(this, collection); }
/** * Remove all keys in the array map that do <b>not</b> exist in the given collection. * @param collection The collection whose contents are to be used to determine which * keys to keep. * @return Returns true if any keys were removed from the array map, else false. */ public boolean retainAll(Collection<?> collection) { return MapCollections.retainAllHelper(this, collection); }
/** * Return a {@link java.util.Collection} for iterating over and interacting with all values * in the array map. * * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it * requires generating a number of temporary objects.</p> */ @Override public Collection<V> values() { return getCollection().getValues(); } }
/** * Return a {@link java.util.Set} for iterating over and interacting with all mappings * in the array map. * * <p><b>Note:</b> this is a very inefficient way to access the array contents, it * requires generating a number of temporary objects.</p> * * <p><b>Note:</b></p> the semantics of this * Set are subtly different than that of a {@link java.util.HashMap}: most important, * the {@link java.util.Map.Entry Map.Entry} object returned by its iterator is a single * object that exists for the entire iterator, so you can <b>not</b> hold on to it * after calling {@link java.util.Iterator#next() Iterator.next}.</p> */ @Override public Set<Entry<K, V>> entrySet() { return getCollection().getEntrySet(); }
public Object[] toArrayHelper(int offset) { final int N = colGetSize(); Object[] result = new Object[N]; for (int i=0; i<N; i++) { result[i] = colGetEntry(i, offset); } return result; };
/** * Return an {@link java.util.Iterator} over all values in the set. * * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it * requires generating a number of temporary objects and allocates additional state * information associated with the container that will remain for the life of the container.</p> */ @Override public Iterator<E> iterator() { return getCollection().getKeySet().iterator(); }