Home / Class/ Iter Class — netty Architecture

Iter Class — netty Architecture

Architecture documentation for the Iter class in ConcurrentSkipListIntObjMultimap.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0ea610ee_82a9_e3f5_439a_eac3ffde1b52["Iter"]
  2dc2d6e5_c15a_8f05_f928_659448d21a9f["ConcurrentSkipListIntObjMultimap.java"]
  0ea610ee_82a9_e3f5_439a_eac3ffde1b52 -->|defined in| 2dc2d6e5_c15a_8f05_f928_659448d21a9f
  332467ec_19e6_8527_e6e8_e18eb02ccff6["Iter()"]
  0ea610ee_82a9_e3f5_439a_eac3ffde1b52 -->|method| 332467ec_19e6_8527_e6e8_e18eb02ccff6
  fc19da19_be12_9144_3f60_29ab72ee63cd["hasNext()"]
  0ea610ee_82a9_e3f5_439a_eac3ffde1b52 -->|method| fc19da19_be12_9144_3f60_29ab72ee63cd
  e523ebdb_4347_12dd_fc5c_2464c417bac0["advance()"]
  0ea610ee_82a9_e3f5_439a_eac3ffde1b52 -->|method| e523ebdb_4347_12dd_fc5c_2464c417bac0
  02990dff_c939_c57d_3b90_c70414aaa93a["remove()"]
  0ea610ee_82a9_e3f5_439a_eac3ffde1b52 -->|method| 02990dff_c939_c57d_3b90_c70414aaa93a

Relationship Graph

Source Code

common/src/main/java/io/netty/util/concurrent/ConcurrentSkipListIntObjMultimap.java lines 1461–1503

    abstract class Iter<T> implements Iterator<T> {
        /** the last node returned by next() */
        Node<V> lastReturned;
        /** the next node to return from next(); */
        Node<V> next;
        /** Cache of next value field to maintain weak consistency */
        V nextValue;

        /** Initializes ascending iterator for entire range. */
        Iter() {
            advance(baseHead());
        }

        @Override
        public final boolean hasNext() {
            return next != null;
        }

        /** Advances next to higher entry. */
        final void advance(Node<V> b) {
            Node<V> n = null;
            V v = null;
            if ((lastReturned = b) != null) {
                while ((n = b.next) != null && (v = n.val) == null) {
                    b = n;
                }
            }
            nextValue = v;
            next = n;
        }

        @Override
        public final void remove() {
            Node<V> n; int k;
            if ((n = lastReturned) == null || (k = n.key) == noKey) {
                throw new IllegalStateException();
            }
            // It would not be worth all of the overhead to directly
            // unlink from here. Using remove is fast enough.
            ConcurrentSkipListIntObjMultimap.this.remove(k, n.val); // TODO: inline and optimize this
            lastReturned = null;
        }
    }

Frequently Asked Questions

What is the Iter class?
Iter is a class in the netty codebase, defined in common/src/main/java/io/netty/util/concurrent/ConcurrentSkipListIntObjMultimap.java.
Where is Iter defined?
Iter is defined in common/src/main/java/io/netty/util/concurrent/ConcurrentSkipListIntObjMultimap.java at line 1461.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free