h2/src/main/org/h2/mvstore/db/TransactionStore.java
/**
         * Iterate over entries.
         *
         * @param from the first key to return
         * @return the iterator
         */
Iterate over entries.
@param from the first key to return
@return the iterator
Iterate over entries . @param from the first key to return @return the iterator
public Iterator<Entry<K, V>> entryIterator(K from) {
            final Cursor<K, VersionedValue> cursor = map.cursor(from);
            return new Iterator<Entry<K, V>>() {
                private Entry<K, V> current;
                {
                    fetchNext();
                }
                private void fetchNext() {
                    while (cursor.hasNext()) {
                        final K key = cursor.next();
                        VersionedValue data = cursor.getValue();
                        data = getValue(key, readLogId, data);
                        if (data != null && data.value != null) {
                            @SuppressWarnings("unchecked")
                            final V value = (V) data.value;
                            current = new DataUtils.MapEntry<K, V>(key, value);
                            return;
                        }
                    }
                    current = null;
                }
                @Override
                public boolean hasNext() {
                    return current != null;
                }
                @Override
                public Entry<K, V> next() {
                    Entry<K, V> result = current;
                    fetchNext();
                    return result;
                }
                @Override
                public void remove() {
                    throw DataUtils.newUnsupportedOperationException(
                            "Removing is not supported");
                }
            };
        }
public Iterator < Entry < K , V > > entryIterator ( K from ) { final Cursor < K , VersionedValue > cursor = map . cursor ( from ) ; return new Iterator < Entry < K , V > > ( ) { private Entry < K , V > current ; { fetchNext ( ) ; } private void fetchNext ( ) { while ( cursor . hasNext ( ) ) { final K key = cursor . next ( ) ; VersionedValue data = cursor . getValue ( ) ; data = getValue ( key , readLogId , data ) ; if ( data != null && data . value != null ) { @ SuppressWarnings ( "unchecked" ) final V value = ( V ) data . value ; current = new DataUtils . MapEntry < K , V > ( key , value ) ; return ; } } current = null ; } @ Override public boolean hasNext ( ) { return current != null ; } @ Override public Entry < K , V > next ( ) { Entry < K , V > result = current ; fetchNext ( ) ; return result ; } @ Override public void remove ( ) { throw DataUtils . newUnsupportedOperationException ( "Removing is not supported" ) ; } } ; }
Iterate over entries.
Iterate over entries .