Insert a new item into queue.
@param v the index of item.
428732
public void insert(int v) {
        pq[++n] = v;
        qp[v] = n;
        swim(n);
    }
634902
public void addExistingItem(final ItemsNodeInterval newNode) {
        Preconditions.checkState(newNode.getItems().size() == 1, "Invalid node=%s", newNode);
        final Item item = newNode.getItems().get(0);

        addNode(newNode,
                new AddNodeCallback() {
                    @Override
                    public boolean onExistingNode(final NodeInterval existingNode) {
                        final ItemsInterval existingOrNewNodeItems = ((ItemsNodeInterval) existingNode).getItemsInterval();
                        existingOrNewNodeItems.add(item);
                        // There is no new node added but instead we just populated the list of items for the already existing node
                        return false;
                    }

                    @Override
                    public boolean shouldInsertNode(final NodeInterval insertionNode) {
                        // Always want to insert node in the tree when we find the right place.
                        return true;
                    }
                });
    }
307213
public void insert(StringBuilder buffer, Object value, int index) {
        if (buffer == null) {
            throw new NullPointerException("buffer");
        }

        buffer.insert(index, value);
    }
631075
public synchronized T addItem(V item) {
        if(item == null) {
            return self();
        }

        items.add(item);
        if(selectedIndex == -1) {
            selectedIndex = 0;
        }
        invalidate();
        return self();
    }
446002
public void add(Key k, Value v) throws IllegalArgumentException {
    add(k, v.get());
  }
470285
public void queueObject (@Nonnull final IIndexerWorkItem aItem)
  {
    ValueEnforcer.notNull (aItem, "Item");
    m_aImmediateCollector.queueObject (aItem);
  }
1228506
protected void set(V v) {
        if (U.compareAndSwapInt(this, STATE, NEW, COMPLETING)) {
            outcome = v;
            U.putOrderedInt(this, STATE, NORMAL); // final state
            finishCompletion();
        }
    }
996222
public void addNextValue(Object val) {
    String newVal = val.toString();
    if (this.minVal == null || this.minVal.compareTo(newVal) > 0) {
      this.minVal = newVal;
    }
  }
602503
public void add(T value) {
        Element<T> e = new Element<T>(value);
        queue.offer(e);
    }
1016554
def enqueue(self, item_type, item):
        """"""

        with self.enlock:
            self.queue[item_type].append(item)
923033
def put(self, item, block=True, timeout=None):
        """"""
        return self._queue.put(item, block, timeout)
846222
def insert(self, var, value, index=None):
        
        current = self.__get(var)
        if not isinstance(current, list):
            raise KeyError("%s: is not a list" % var)
        if index is None:
            current.append(value)
        else:
            current.insert(index, value)
        if self.auto_save:
            self.save()
1222415
private void fillQueue(QueueItem item, Integer minStartPosition,
      Integer maxStartPosition, Integer minEndPosition) throws IOException {
    int newStartPosition;
    int newEndPosition;
    Integer firstRetrievedPosition = null;
    // remove everything below minStartPosition
    if ((minStartPosition != null) && (item.lowestPosition != null)
        && (item.lowestPosition < minStartPosition)) {
      item.del((minStartPosition - 1));
    }
    // fill queue
    while (!item.noMorePositions) {
      boolean doNotCollectAnotherPosition;
      doNotCollectAnotherPosition = item.filledPosition
          && (minStartPosition == null) && (maxStartPosition == null);
      doNotCollectAnotherPosition |= item.filledPosition
          && (maxStartPosition != null) && (item.lastRetrievedPosition != null)
          && (maxStartPosition < item.lastRetrievedPosition);
      if (doNotCollectAnotherPosition) {
        return;
      } else {
        // collect another full position
        firstRetrievedPosition = null;
        while (!item.noMorePositions) {
          newStartPosition = item.sequenceSpans.spans.nextStartPosition();
          if (newStartPosition == NO_MORE_POSITIONS) {
            if (!item.queue.isEmpty()) {
              item.filledPosition = true;
              item.lastFilledPosition = item.lastRetrievedPosition;
            }
            item.noMorePositions = true;
            return;
          } else if ((minStartPosition != null)
              && (newStartPosition < minStartPosition)) {
            // do nothing
          } else {
            newEndPosition = item.sequenceSpans.spans.endPosition();
            if ((minEndPosition == null) || (newEndPosition >= minEndPosition
                - ignoreItem.getMinStartPosition(docId, newEndPosition))) {
              item.add(newStartPosition, newEndPosition);
              if (firstRetrievedPosition == null) {
                firstRetrievedPosition = newStartPosition;
              } else if (!firstRetrievedPosition.equals(newStartPosition)) {
                break;
              }
            }
          }
        }
      }
    }
  }
163197
public void addItem(T item) {
        mListItems.add(item);
        notifyItemInserted(mListItems.indexOf(item));
    }
1137607
def queue_push(object)
      queue_item = QueueItem.new( :kind => "push",
                                  :object_type => object.class.name,
                                  :object_local_id => object.id,
                                  :state => "new" )
      queue_item.save
    end
1275007
public void add( int val ) 
    {
        if ( size == items.length ) 
            resize( items.length * 2 + 1 );
        items[size++] = val;
    }
643728
public void put(E e) throws InterruptedException {
        Objects.requireNonNull(e);
        final ReentrantLock lock = this.lock;
        lock.lockInterruptibly();
        try {
            while (count == items.length)
                notFull.await();
            enqueue(e);
        } finally {
            lock.unlock();
        }
    }