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