Home / Function/ offer() — netty Function Reference

offer() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  276f0f9e_51f5_c26e_cd5c_b7cbc2b6d3aa["offer()"]
  346d98e4_880c_f43c_7c90_38ef8a6cab37["DefaultPriorityQueue"]
  276f0f9e_51f5_c26e_cd5c_b7cbc2b6d3aa -->|defined in| 346d98e4_880c_f43c_7c90_38ef8a6cab37
  9587b963_47e6_e495_a3f6_78de25f718b2["bubbleUp()"]
  276f0f9e_51f5_c26e_cd5c_b7cbc2b6d3aa -->|calls| 9587b963_47e6_e495_a3f6_78de25f718b2
  style 276f0f9e_51f5_c26e_cd5c_b7cbc2b6d3aa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java lines 85–103

    @Override
    public boolean offer(T e) {
        if (e.priorityQueueIndex(this) != INDEX_NOT_IN_QUEUE) {
            throw new IllegalArgumentException("e.priorityQueueIndex(): " + e.priorityQueueIndex(this) +
                    " (expected: " + INDEX_NOT_IN_QUEUE + ") + e: " + e);
        }

        // Check that the array capacity is enough to hold values by doubling capacity.
        if (size >= queue.length) {
            // Use a policy which allows for a 0 initial capacity. Same policy as JDK's priority queue, double when
            // "small", then grow by 50% when "large".
            queue = Arrays.copyOf(queue, queue.length + ((queue.length < 64) ?
                                                         (queue.length + 2) :
                                                         (queue.length >>> 1)));
        }

        bubbleUp(size++, e);
        return true;
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does offer() do?
offer() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java.
Where is offer() defined?
offer() is defined in common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java at line 85.
What does offer() call?
offer() calls 1 function(s): bubbleUp.

Analyze Your Own Codebase

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

Try Supermodel Free