MATSIM
IdMap.java
Go to the documentation of this file.
1 package org.matsim.api.core.v01;
2 
3 import java.util.Arrays;
4 import java.util.Collection;
5 import java.util.HashSet;
6 import java.util.Iterator;
7 import java.util.Map;
8 import java.util.NoSuchElementException;
9 import java.util.Objects;
10 import java.util.Set;
11 import java.util.function.BiConsumer;
12 
16 public class IdMap<T, V> implements Map<Id<T>, V>, Iterable<V> {
17 
18  private static final int INCREMENT = 100;
19  private static final float INCREMENT_FACTOR = 1.5f;
20  private final Class<T> idClass;
21  private int size = 0;
22  private Object[] data;
23 
24  public IdMap(Class<T> idClass) {
25  this(idClass, Math.max(Id.getNumberOfIds(idClass), INCREMENT));
26  }
27 
28  public IdMap(Class<T> idClass, int size) {
29  this.idClass = idClass;
30  this.data = new Object[size];
31  }
32 
33  @Override
34  public int size() {
35  return this.size;
36  }
37 
38  @Override
39  public boolean isEmpty() {
40  return this.size == 0;
41  }
42 
43  @Override
44  public boolean containsKey(Object key) {
45  if (key instanceof Id) {
46  return containsKey((Id<T>) key);
47  }
48  return false;
49  }
50 
51  @Override
52  public boolean containsValue(Object value) {
53  Objects.requireNonNull(value);
54  for (Object v : this.data) {
55  if (v != null && value.equals(v)) {
56  return true;
57  }
58  }
59  return false;
60  }
61 
62  @Override
63  public V get(Object key) {
64  if (key instanceof Id) {
65  return get((Id<T>) key);
66  }
67  return null;
68  }
69 
70  @Override
71  public V remove(Object key) {
72  if (key instanceof Id) {
73  return remove((Id<T>) key);
74  }
75  return null;
76  }
77 
78  @Override
79  public void putAll(Map<? extends Id<T>, ? extends V> m) {
80  int maxIndex = 0;
81  for (Id<T> k : m.keySet()) {
82  int index = k.index();
83  if (index > maxIndex) {
84  maxIndex = index;
85  }
86  }
87  ensureCapacity(maxIndex);
88 
89  m.forEach((k, v) -> {
90  int index = k.index();
91  Object oldValue = this.data[index];
92  this.data[k.index()] = v;
93  if (v != null && oldValue == null) {
94  this.size++;
95  }
96  if (v == null && oldValue != null) {
97  this.size--;
98  }
99  });
100  }
101 
102  public void putAll(IdMap<T, ? extends V> m) {
103  this.ensureCapacity(m.data.length - 1);
104  for (int i = 0; i < m.data.length; i++) {
105  Object value = m.data[i];
106  if (value != null) {
107  Object oldValue = this.data[i];
108  this.data[i] = value;
109  if (oldValue == null) {
110  this.size++;
111  }
112  }
113  }
114  }
115 
116  public boolean containsKey(Id<T> key) {
117  int idx = key.index();
118  return idx < this.data.length && this.data[idx] != null;
119  }
120 
121  public boolean containsKey(int index) {
122  return index < this.data.length && this.data[index] != null;
123  }
124 
125  public V get(Id<T> key) {
126  int idx = key.index();
127  if (idx < this.data.length) {
128  return (V) this.data[idx];
129  }
130  return null;
131  }
132 
133  public V get(int index) {
134  if (index < this.data.length) {
135  return (V) this.data[index];
136  }
137  return null;
138  }
139 
140  @Override
141  public V put(Id<T> key, V value) {
142  return this.put(key.index(), value);
143  }
144 
145  V put(int index, V value) {
146  ensureCapacity(index);
147  Object oldValue = this.data[index];
148  this.data[index] = value;
149  if (value != null && oldValue == null) {
150  this.size++;
151  }
152  if (value == null && oldValue != null) {
153  this.size--;
154  }
155  return (V) oldValue;
156  }
157 
158  private void ensureCapacity(int index) {
159  if (index >= this.data.length) {
160  int newSize = Math.max(index + INCREMENT, (int)(data.length * INCREMENT_FACTOR));
161  Object[] tmp = new Object[newSize];
162  System.arraycopy(this.data, 0, tmp, 0, this.data.length);
163  this.data = tmp;
164  }
165  }
166  public V remove(Id<T> key) {
167  return this.remove(key.index());
168  }
169 
170  V remove(int idx) {
171  if (idx < this.data.length) {
172  Object oldValue = this.data[idx];
173  this.data[idx] = null;
174  if (oldValue != null) {
175  this.size--;
176  }
177  return (V) oldValue;
178  }
179  return null;
180  }
181 
182  @Override
183  public void clear() {
184  this.size = 0;
185  Arrays.fill(this.data, null);
186  }
187 
188  @Override
189  public Set<Id<T>> keySet() {
190  return new KeySet<>(this);
191  }
192 
193  @Override
194  public void forEach(BiConsumer<? super Id<T>, ? super V> action) {
195  for (int i = 0; i < this.data.length; i++) {
196  Object o = this.data[i];
197  if (o != null) {
198  action.accept(Id.get(i, this.idClass), (V) o);
199  }
200  }
201  }
202 
203  @Override
204  public Collection<V> values() {
205  return new DataCollection<T, V>(this);
206  }
207 
208  @Override
209  public Set<Map.Entry<Id<T>, V>> entrySet() {
210  return new EntrySet<T, V>(this);
211  }
212 
213  @Override
214  public Iterator<V> iterator() {
215  return new DataIterator<>(this);
216  }
217 
218  @Override
219  public boolean equals(Object o) {
220  if (o == this)
221  return true;
222  if (!(o instanceof Map))
223  return false;
224  if (o instanceof IdMap) {
225  IdMap<?, ?> m = (IdMap<?, ?>) o;
226  if (this.size != m.size)
227  return false;
228  for (int i = 0; i < this.data.length && i < m.data.length; i++) { // one of the data arrays may have more capacity than the other despite having the same number of non-null entries. This is okay if and only if the additional entries are null. This gets checked implicitly by the loop because we already know they have the same number of nun-null elements.
229  if (this.data[i] != m.data[i])
230  return false;
231  }
232  return true;
233  } else {
234  Map<Id<?>, ?> m = (Map<Id<?>, ?>) o;
235  try {
236  Iterator<java.util.Map.Entry<Id<T>, V>> iter = entrySet().iterator();
237  while (iter.hasNext()) {
238  java.util.Map.Entry<Id<T>, V> e = iter.next();
239  Id<T> key = e.getKey();
240  V value = e.getValue();
241  if (value == null) {
242  if (!(m.get(key) == null && m.containsKey(key)))
243  return false;
244  } else {
245  if (!value.equals(m.get(key)))
246  return false;
247  }
248  }
249  } catch (ClassCastException | NullPointerException noIdAsKey) {
250  return false;
251  }
252  return true;
253  }
254  }
255 
256  @Override
257  public int hashCode() {
258  int h = 0;
259  for (int i = 0; i < data.length; i++) {
260  h += data[i] == null ? 0 : i ^ data[i].hashCode();
261  }
262  return h;
263  }
264 
265  private static class DataCollection<K, V> implements Collection<V> {
266 
267  private final IdMap<K, V> map;
268 
269  public DataCollection(IdMap map) {
270  this.map = map;
271  }
272 
273  @Override
274  public int size() {
275  return this.map.size();
276  }
277 
278  @Override
279  public boolean isEmpty() {
280  return this.map.isEmpty();
281  }
282 
283  @Override
284  public boolean contains(Object o) {
285  return this.map.containsValue(o);
286  }
287 
288  @Override
289  public Iterator<V> iterator() {
290  return new DataIterator<K, V>(this.map);
291  }
292 
293  @Override
294  public Object[] toArray() {
295  Object[] array = new Object[this.map.size];
296  int index = 0;
297  for (Object v : this.map.data) {
298  if (v != null) {
299  array[index] = v;
300  index++;
301  }
302  }
303  return array;
304  }
305 
306  @Override
307  public <T> T[] toArray(T[] a) {
308  T[] values = a;
309  if (values == null) {
310  values = (T[]) new Object[this.map.size];
311  } else if (values.length < this.map.size) {
312  values = Arrays.copyOf(values, this.map.size);
313  } else if (values.length > this.map.size) {
314  Arrays.fill(values, this.map.size, values.length, null);
315  }
316 
317  int index = 0;
318  for (Object v : this.map.data) {
319  if (v != null) {
320  values[index] = (T) v;
321  index++;
322  }
323  }
324 
325  return values;
326  }
327 
328  @Override
329  public boolean add(V v) {
330  throw new UnsupportedOperationException();
331  }
332 
333  @Override
334  public boolean remove(Object o) {
335  if (o == null) {
336  return false;
337  }
338  Object[] data = this.map.data;
339  for (int i = 0; i < data.length; i++) {
340  if (o.equals(data[i])) {
341  this.map.remove(i);
342  return true;
343  }
344  }
345  return false;
346  }
347 
348  @Override
349  public boolean containsAll(Collection<?> c) {
350  for (Object o : c) {
351  if (!this.map.containsValue(o)) {
352  return false;
353  }
354  }
355  return true;
356  }
357 
358  @Override
359  public boolean addAll(Collection<? extends V> c) {
360  throw new UnsupportedOperationException();
361  }
362 
363  @Override
364  public boolean removeAll(Collection<?> c) {
365  boolean changed = false;
366  for (Object o : c) {
367  changed = this.remove(o) | changed;
368  }
369  return changed;
370  }
371 
372  @Override
373  public boolean retainAll(Collection<?> c) {
374  boolean changed = false;
375  Set<?> set = new HashSet<>(c);
376  Object[] data = this.map.data;
377  for (int i = 0; i < data.length; i++) {
378  Object v = data[i];
379  if (!set.contains(v)) {
380  this.map.data[i] = null;
381  this.map.size--;
382  changed = true;
383  }
384  }
385  return changed;
386  }
387 
388  @Override
389  public void clear() {
390  this.map.clear();
391  }
392  }
393 
394  private static class DataIterator<K, V> implements Iterator<V> {
395 
396  private final IdMap<K, V> map;
397  private final Object[] data;
398  private int index = 0;
399  private int currentIndex = -1;
400  private int nextIndex = -1;
401  private Object next;
402 
404  this.map = map;
405  this.data = map.data;
406  findNext();
407  }
408 
409  private void findNext() {
410  this.next = null;
411  while (this.next == null && this.index < this.data.length) {
412  this.nextIndex = this.index;
413  this.next = this.data[this.index];
414  this.index++;
415  }
416  }
417 
418  @Override
419  public boolean hasNext() {
420  return this.next != null ;
421  }
422 
423  @Override
424  public V next() {
425  if (this.next == null) {
426  throw new NoSuchElementException();
427  }
428  Object tmp = this.next;
429  this.currentIndex = this.nextIndex;
430  findNext();
431  return (V) tmp;
432  }
433 
434  @Override
435  public void remove() {
436  this.map.remove(this.currentIndex);
437  }
438  }
439 
440  private static class IdIterator<T, D> implements Iterator<Id<T>> {
441 
442  private final D[] data;
443  private final Class<T> idClass;
444  private int index = 0;
445  private Id<T> next;
446 
447  IdIterator(D[] data, Class<T> idClass) {
448  this.data = data;
449  this.idClass = idClass;
450  findNext();
451  }
452 
453  private void findNext() {
454  this.next = null;
455  while (this.next == null && this.index < this.data.length) {
456  if (this.data[this.index] != null) {
457  this.next = Id.get(this.index, this.idClass);
458  }
459  this.index++;
460  }
461  }
462 
463  @Override
464  public boolean hasNext() {
465  return this.next != null ;
466  }
467 
468  @Override
469  public Id<T> next() {
470  Id<T> tmp = this.next;
471  findNext();
472  return tmp;
473  }
474  }
475 
476  private static class KeySet<T, V> implements Set<Id<T>> {
477 
478  private final IdMap<T, V> map;
479 
480  KeySet(IdMap<T, V> map) {
481  this.map = map;
482  }
483 
484  @Override
485  public int size() {
486  return this.map.size;
487  }
488 
489  @Override
490  public boolean isEmpty() {
491  return this.map.isEmpty();
492  }
493 
494  @Override
495  public boolean contains(Object o) {
496  return this.map.containsKey(o);
497  }
498 
499  @Override
500  public Iterator<Id<T>> iterator() {
501  return new IdIterator<>(this.map.data, this.map.idClass);
502  }
503 
504  @Override
505  public Id<T>[] toArray() {
506  return toArray(new Id[this.map.size]);
507  }
508 
509  @Override
510  public <K> K[] toArray(K[] a) {
511  Id[] keys = (Id[]) a;
512  if (keys == null) {
513  keys = new Id[this.map.size];
514  } else if (keys.length < this.map.size) {
515  keys = Arrays.copyOf(keys, this.map.size);
516  } else if (keys.length > this.map.size) {
517  Arrays.fill(keys, this.map.size, keys.length, null);
518  }
519 
520  int count = 0;
521  Object[] values = this.map.data;
522  for (int i = 0; i < values.length; i++) {
523  if (values[i] != null) {
524  keys[count] = Id.get(i, this.map.idClass);
525  count++;
526  }
527  }
528  return (K[]) keys;
529  }
530 
531  @Override
532  public boolean add(Id<T> k) {
533  throw new UnsupportedOperationException();
534  }
535 
536  @Override
537  public boolean remove(Object o) {
538  return this.map.remove(o) != null;
539  }
540 
541  @Override
542  public boolean containsAll(Collection<?> c) {
543  for (Object e : c)
544  if (!contains(e))
545  return false;
546  return true;
547  }
548 
549  @Override
550  public boolean addAll(Collection<? extends Id<T>> c) {
551  throw new UnsupportedOperationException();
552  }
553 
554  @Override
555  public boolean retainAll(Collection<?> c) {
556  Set<Id<?>> ids = new HashSet<>();
557  for (Object o : c) {
558  if (o instanceof Id) {
559  ids.add((Id<?>) o);
560  }
561  }
562  boolean changed = false;
563  for (int i = 0; i < this.map.data.length; i++) {
564  if (this.map.data[i] != null) {
565  Id<T> t = Id.get(i, this.map.idClass);
566  if (!ids.contains(t)) {
567  this.map.data[i] = null;
568  this.map.size--;
569  changed = true;
570  }
571  }
572  }
573  return changed;
574  }
575 
576  @Override
577  public boolean removeAll(Collection<?> c) {
578  Set<Id<?>> ids = new HashSet<>();
579  for (Object o : c) {
580  if (o instanceof Id) {
581  ids.add((Id<?>) o);
582  }
583  }
584  boolean changed = false;
585  for (int i = 0; i < this.map.data.length; i++) {
586  if (this.map.data[i] != null) {
587  Id<T> t = Id.get(i, this.map.idClass);
588  if (ids.contains(t)) {
589  this.map.data[i] = null;
590  this.map.size--;
591  changed = true;
592  }
593  }
594  }
595  return changed;
596  }
597 
598  @Override
599  public void clear() {
600  this.map.clear();
601  }
602 
603  @Override
604  public boolean equals(Object o) {
605  if (o == this)
606  return true;
607  if (!(o instanceof Set))
608  return false;
609  if (o instanceof KeySet) {
610  KeySet<?, ?> k = (KeySet<?, ?>) o;
611  if (this.size() != k.size())
612  return false;
613  for (int i = 0; i < this.map.data.length && i < k.map.data.length; i++) { // one of the data arrays may have more capacity than the other despite having the same number of non-null entries. This is okay if and only if the additional entries are null. This gets checked implicitly by the loop because we already know they have the same number of nun-null elements.
614  if ((this.map.data[i] == null && k.map.data[i] != null) || (this.map.data[i] != null && k.map.data[i] == null))
615  return false;
616  }
617  return true;
618  } else {
619  Collection<?> c = (Collection<?>) o;
620  if (c.size() != size())
621  return false;
622  try {
623  return containsAll(c);
624  } catch (ClassCastException | NullPointerException unused) {
625  return false;
626  }
627  }
628  }
629 
630  @Override
631  public int hashCode() {
632  int h = 0;
633  for (int i = 0; i < this.map.data.length; i++) {
634  h += this.map.data[i] == null ? 0 : i;
635  }
636  return h;
637  }
638  }
639 
640  private static class EntrySet<T, V> implements Set<Map.Entry<Id<T>, V>> {
641 
642  private final IdMap<T, V> map;
643 
644  EntrySet(IdMap<T, V> map) {
645  this.map = map;
646  }
647 
648  @Override
649  public int size() {
650  return this.map.size();
651  }
652 
653  @Override
654  public boolean isEmpty() {
655  return this.map.isEmpty();
656  }
657 
658  @Override
659  public boolean contains(Object o) {
660  if (o instanceof Map.Entry) {
661  Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
662  return e.getValue().equals(this.map.get(e.getKey()));
663  }
664  return false;
665  }
666 
667  @Override
668  public Iterator<Map.Entry<Id<T>, V>> iterator() {
669  return new EntryIterator<>(this.map);
670  }
671 
672  @Override
673  public Object[] toArray() {
674  return toArray(new Entry[this.map.size]);
675  }
676 
677  @Override
678  public <T> T[] toArray(T[] a) {
679  Entry[] entries = (Entry[]) a;
680  if (entries == null) {
681  entries = new Entry[this.map.size];
682  } else if (entries.length < this.map.size) {
683  entries = Arrays.copyOf(entries, this.map.size);
684  } else if (entries.length > this.map.size) {
685  Arrays.fill(entries, this.map.size, entries.length, null);
686  }
687 
688  int count = 0;
689  Object[] values = this.map.data;
690  for (int i = 0; i < values.length; i++) {
691  if (values[i] != null) {
692  entries[count] = new Entry<>(this.map, i);
693  count++;
694  }
695  }
696  return (T[]) entries;
697  }
698 
699  @Override
700  public boolean add(Map.Entry<Id<T>, V> entry) {
701  throw new UnsupportedOperationException();
702  }
703 
704  @Override
705  public boolean remove(Object o) {
706  if (o instanceof Map.Entry) {
707  Map.Entry e = (Entry) o;
708  Object k = e.getKey();
709  if (k instanceof Id) {
710  Id id = (Id) k;
711  int index = id.index();
712  V value = this.map.get(index);
713  if (value != null && value.equals(e.getValue())) {
714  this.map.remove(id);
715  return true;
716  }
717  }
718  }
719  return false;
720  }
721 
722  @Override
723  public boolean containsAll(Collection<?> c) {
724  throw new UnsupportedOperationException();
725  }
726 
727  @Override
728  public boolean addAll(Collection<? extends Map.Entry<Id<T>, V>> c) {
729  throw new UnsupportedOperationException();
730  }
731 
732  @Override
733  public boolean retainAll(Collection<?> c) {
734  throw new UnsupportedOperationException();
735  }
736 
737  @Override
738  public boolean removeAll(Collection<?> c) {
739  throw new UnsupportedOperationException();
740  }
741 
742  @Override
743  public void clear() {
744  this.map.clear();
745  }
746 
747  @Override
748  public boolean equals(Object o) {
749  if (o == this)
750  return true;
751  if (!(o instanceof Set))
752  return false;
753  if (o instanceof EntrySet) {
755  return this.map.equals(e.map);
756  } else {
757  Collection<?> c = (Collection<?>) o;
758  if (c.size() != size())
759  return false;
760  try {
761  return containsAll(c);
762  } catch (ClassCastException | NullPointerException unused) {
763  return false;
764  }
765  }
766  }
767 
768  @Override
769  public int hashCode() {
770  return this.map.hashCode();
771  }
772  }
773 
774  public static class Entry<T, V> implements Map.Entry<Id<T>, V> {
775 
776  private final IdMap<T, V> map;
777  private final V value;
778  private final int index;
779 
780  public Entry(IdMap<T, V> map, int index) {
781  this.map = map;
782  this.index = index;
783  this.value = this.map.get(index);
784  }
785 
786  @Override
787  public Id<T> getKey() {
788  return Id.get(this.index, this.map.idClass);
789  }
790 
791  @Override
792  public V getValue() {
793  return this.value;
794  }
795 
796  @Override
797  public V setValue(V value) {
798  return this.map.put(this.index, value);
799  }
800 
801  @Override
802  public boolean equals(Object o) {
803  if (this == o) return true;
804  if (!(o instanceof Map.Entry))
805  return false;
806  if (o instanceof Entry) {
807  Entry<?, ?> e = (Entry<?, ?>) o;
808  return this.index == e.index && this.value.equals(e.value); // Since our values should never be null we can skip the null-check they do in AbstractMap#eq(Object, Object)
809  } else {
810  Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
811  if (e.getKey() == null || e.getValue() == null)
812  return false; // our keys and values should never be null
813  return this.getKey().equals(e.getKey()) && this.value.equals(e.getValue());
814  }
815  }
816 
817  @Override
818  public int hashCode() {
819  return index ^ (value == null ? 0 : value.hashCode());
820  }
821  }
822 
823  private static class EntryIterator<T, V> implements Iterator<Map.Entry<Id<T>, V>> {
824 
825  private final IdMap<T, V> map;
826  private final Object[] data;
827  private int index = 0;
828  private Entry<T, V> next;
830 
832  this.map = map;
833  this.data = map.data;
834  findNext();
835  }
836 
837  private void findNext() {
838  this.next = null;
839  while (this.next == null && this.index < this.data.length) {
840  if (this.map.data[this.index] != null) {
841  this.next = new Entry<>(this.map, this.index);
842  }
843  this.index++;
844  }
845  }
846 
847  @Override
848  public boolean hasNext() {
849  return this.next != null ;
850  }
851 
852  @Override
853  public Map.Entry<Id<T>, V> next() {
854  this.current = this.next;
855  findNext();
856  return this.current;
857  }
858 
859  @Override
860  public void remove() {
861  this.map.remove(this.current.index);
862  this.current = null;
863  }
864  }
865 }
Iterator< V > iterator()
Definition: IdMap.java:214
boolean equals(Object o)
Definition: IdMap.java:802
Entry< T, V > next
Definition: IdMap.java:828
boolean containsAll(Collection<?> c)
Definition: IdMap.java:349
final IdMap< T, V > map
Definition: IdMap.java:642
static< T > Id< T > get(int index, final Class< T > type)
Definition: Id.java:112
Entry< T, V > current
Definition: IdMap.java:829
static< T > int getNumberOfIds(final Class< T > type)
Definition: Id.java:122
void ensureCapacity(int index)
Definition: IdMap.java:158
boolean isEmpty()
Definition: IdMap.java:654
V setValue(V value)
Definition: IdMap.java:797
final IdMap< T, V > map
Definition: IdMap.java:776
boolean add(Map.Entry< Id< T >, V > entry)
Definition: IdMap.java:700
boolean equals(Object o)
Definition: IdMap.java:748
Set< Map.Entry< Id< T >, V > > entrySet()
Definition: IdMap.java:209
boolean containsKey(int index)
Definition: IdMap.java:121
Set< Id< T > > keySet()
Definition: IdMap.java:189
final Class< T > idClass
Definition: IdMap.java:20
void forEach(BiConsumer<? super Id< T >, ? super V > action)
Definition: IdMap.java:194
Id< T > getKey()
Definition: IdMap.java:787
boolean contains(Object o)
Definition: IdMap.java:659
boolean containsKey(Object key)
Definition: IdMap.java:44
void clear()
Definition: IdMap.java:743
boolean containsKey(Id< T > key)
Definition: IdMap.java:116
int hashCode()
Definition: IdMap.java:769
V getValue()
Definition: IdMap.java:792
Collection< V > values()
Definition: IdMap.java:204
final IdMap< T, V > map
Definition: IdMap.java:825
boolean removeAll(Collection<?> c)
Definition: IdMap.java:577
IdMap(Class< T > idClass)
Definition: IdMap.java:24
Definition: IdMap.java:774
boolean containsAll(Collection<?> c)
Definition: IdMap.java:542
int hashCode()
Definition: IdMap.java:818
IdMap(Class< T > idClass, int size)
Definition: IdMap.java:28
Entry(IdMap< T, V > map, int index)
Definition: IdMap.java:780
void putAll(Map<? extends Id< T >, ? extends V > m)
Definition: IdMap.java:79
Definition: IdMap.java:640
boolean hasNext()
Definition: IdMap.java:848
static final float INCREMENT_FACTOR
Definition: IdMap.java:19
void findNext()
Definition: IdMap.java:837
boolean equals(Object o)
Definition: IdMap.java:219
Object [] toArray()
Definition: IdMap.java:673
boolean addAll(Collection<? extends Id< T >> c)
Definition: IdMap.java:550
final V value
Definition: IdMap.java:777
boolean retainAll(Collection<?> c)
Definition: IdMap.java:555
static final int INCREMENT
Definition: IdMap.java:18
Iterator< Map.Entry< Id< T >, V > > iterator()
Definition: IdMap.java:668
void putAll(IdMap< T, ? extends V > m)
Definition: IdMap.java:102
Definition: IdMap.java:823
final Object [] data
Definition: IdMap.java:826
boolean containsAll(Collection<?> c)
Definition: IdMap.java:723
Iterator< Id< T > > iterator()
Definition: IdMap.java:500
V put(Id< T > key, V value)
Definition: IdMap.java:141
int size()
Definition: IdMap.java:649
Map.Entry< Id< T >, V > next()
Definition: IdMap.java:853
boolean retainAll(Collection<?> c)
Definition: IdMap.java:373
boolean containsValue(Object value)
Definition: IdMap.java:52
boolean removeAll(Collection<?> c)
Definition: IdMap.java:738
boolean addAll(Collection<? extends V > c)
Definition: IdMap.java:359
boolean addAll(Collection<? extends Map.Entry< Id< T >, V >> c)
Definition: IdMap.java:728
boolean retainAll(Collection<?> c)
Definition: IdMap.java:733
final int index
Definition: IdMap.java:778
boolean removeAll(Collection<?> c)
Definition: IdMap.java:364