/** * Iterate backwards w.r.t the buffer, to * minimize collision chains when filling another hash container (ex. with putAll()) */ @Override protected ByteDoubleCursor fetch() { if (this.cursor.index == ByteDoubleHashMap.this.keys.length + 1) { if (ByteDoubleHashMap.this.allocatedDefaultKey) { this.cursor.index = ByteDoubleHashMap.this.keys.length; this.cursor.key = ((byte)0); this.cursor.value = ByteDoubleHashMap.this.allocatedDefaultKeyValue; return this.cursor; } //no value associated with the default key, continue iteration... this.cursor.index = ByteDoubleHashMap.this.keys.length; } int i = this.cursor.index - 1; while (i >= 0 && !(!(((((ByteDoubleHashMap.this.keys)))[(i)]) == (byte)0))) { i--; } if (i == -1) { return done(); } this.cursor.index = i; this.cursor.key = ((ByteDoubleHashMap.this.keys[i])); this.cursor.value = ((ByteDoubleHashMap.this.values[i])); return this.cursor; } }
@Override public EntryIterator create() { return new EntryIterator(); }