public <T> T[] toArray(T[] arr) { // special implementation to handle disappearing entries ArrayList<Map.Entry<K, V>> list = new ArrayList<Map.Entry<K, V>>(); Iterator<Map.Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { Map.Entry<K, V> e = iterator.next(); list.add(new DefaultMapEntry<K, V>(e.getKey(), e.getValue())); } return list.toArray(arr); } }
public Object[] toArray() { return toArray(new Object[0]); }
public Object[] toArray() { return toArray(new Object[0]); }
/** * Returns a set view of this map's entries. * An iterator returned entry is valid until <code>next()</code> is called again. * The <code>setValue()</code> method on the <code>toArray</code> entries has no effect. * * @return a set view of this map's entries */ public Set<Map.Entry<K, V>> entrySet() { if (entrySet == null) { entrySet = new ReferenceEntrySet<K, V>(this); } return entrySet; }
public Object[] toArray() { return toArray(new Object[0]); }
/** * Returns a set view of this map's entries. * An iterator returned entry is valid until <code>next()</code> is called again. * The <code>setValue()</code> method on the <code>toArray</code> entries has no effect. * * @return a set view of this map's entries */ public Set<Map.Entry<K, V>> entrySet() { if (entrySet == null) { entrySet = new ReferenceEntrySet<K, V>(this); } return entrySet; }
public <T> T[] toArray(T[] arr) { // special implementation to handle disappearing entries ArrayList<Entry<K, V>> list = new ArrayList<Entry<K, V>>(); Iterator<Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { Entry<K, V> e = iterator.next(); list.add(new DefaultMapEntry<K, V>(e.getKey(), e.getValue())); } return list.toArray(arr); } }
/** * Returns a set view of this map's entries. * An iterator returned entry is valid until <code>next()</code> is called again. * The <code>setValue()</code> method on the <code>toArray</code> entries has no effect. * * @return a set view of this map's entries */ public Set<Entry<K, V>> entrySet() { if (entrySet == null) { entrySet = new ReferenceEntrySet<K, V>(this); } return entrySet; }
public <T> T[] toArray(T[] arr) { // special implementation to handle disappearing entries ArrayList<Map.Entry<K, V>> list = new ArrayList<Map.Entry<K, V>>(); Iterator<Map.Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { Map.Entry<K, V> e = iterator.next(); list.add(new DefaultMapEntry<K, V>(e.getKey(), e.getValue())); } return list.toArray(arr); } }