Home / Function/ removeTyped() — netty Function Reference

removeTyped() — netty Function Reference

Architecture documentation for the removeTyped() function in DefaultPriorityQueue.java from the netty codebase.

Function java CommonUtil Internal calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  6996c51b_528d_1b1c_08f8_4dfd8f453075["removeTyped()"]
  346d98e4_880c_f43c_7c90_38ef8a6cab37["DefaultPriorityQueue"]
  6996c51b_528d_1b1c_08f8_4dfd8f453075 -->|defined in| 346d98e4_880c_f43c_7c90_38ef8a6cab37
  550f6a91_6598_70b6_e8bf_5a85b7bb682a["remove()"]
  550f6a91_6598_70b6_e8bf_5a85b7bb682a -->|calls| 6996c51b_528d_1b1c_08f8_4dfd8f453075
  8e6d6a10_6d35_41b9_fd4a_3fe2ba605d38["contains()"]
  6996c51b_528d_1b1c_08f8_4dfd8f453075 -->|calls| 8e6d6a10_6d35_41b9_fd4a_3fe2ba605d38
  5bca67c4_7315_0584_7bc2_ff5459c9ec18["bubbleDown()"]
  6996c51b_528d_1b1c_08f8_4dfd8f453075 -->|calls| 5bca67c4_7315_0584_7bc2_ff5459c9ec18
  9587b963_47e6_e495_a3f6_78de25f718b2["bubbleUp()"]
  6996c51b_528d_1b1c_08f8_4dfd8f453075 -->|calls| 9587b963_47e6_e495_a3f6_78de25f718b2
  style 6996c51b_528d_1b1c_08f8_4dfd8f453075 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java lines 139–165

    @Override
    public boolean removeTyped(T node) {
        int i = node.priorityQueueIndex(this);
        if (!contains(node, i)) {
            return false;
        }

        node.priorityQueueIndex(this, INDEX_NOT_IN_QUEUE);
        if (--size == 0 || size == i) {
            // If there are no node left, or this is the last node in the array just remove and return.
            queue[i] = null;
            return true;
        }

        // Move the last element where node currently lives in the array.
        T moved = queue[i] = queue[size];
        queue[size] = null;
        // priorityQueueIndex will be updated below in bubbleUp or bubbleDown

        // Make sure the moved node still preserves the min-heap properties.
        if (comparator.compare(node, moved) < 0) {
            bubbleDown(i, moved);
        } else {
            bubbleUp(i, moved);
        }
        return true;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does removeTyped() do?
removeTyped() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java.
Where is removeTyped() defined?
removeTyped() is defined in common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java at line 139.
What does removeTyped() call?
removeTyped() calls 3 function(s): bubbleDown, bubbleUp, contains.
What calls removeTyped()?
removeTyped() is called by 1 function(s): remove.

Analyze Your Own Codebase

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

Try Supermodel Free