Inserts an element into the queue.

@param object
the element to insert

@return {@code true} if a new element has been inserted (i.e., the size has grown), {@code false} otherwise
(i.e., an existing element has been replaced)
439974
public boolean insert(E object) {
        storage.ensureCapacity(size + 1);
        storage.array[size++] = object;
        if (!upHeap()) {
            size--;
            return false;
        }
        return true;
    }
1009599
int add(T object) {
        int positionOfInsert = mObjects.size();
        mObjects.add(object);
        return positionOfInsert;
    }
419471
public boolean add(Object o) {

        resetCapacity();

        if (endindex == list.length) {
            endindex = 0;
        }

        list[endindex] = o;

        elementCount++;
        endindex++;

        return true;
    }
1041836
@Override
    public boolean remove(Object object) {
        int index = object == null ? indexOfNull() : indexOf(object, object.hashCode());
        if (index >= 0) {
            removeAt(index);
            return true;
        }
        return false;
    }
132352
public boolean add(Object o) {
        // find the index where this item should go
        // add the item @ the specified index
        int idx = 0;
        if(!isEmpty()) {
            idx = findInsertionPoint(o);
        }

        try {
            super.add(idx, o);
        }
        catch(IndexOutOfBoundsException e) {
            return false;
        }
        return true;
    }
1056554
public boolean offer(ObjectContainer<T> item)
  {
    final long itemLength = item.getSize();

    if (currentMemory.addAndGet(itemLength) <= memoryBound) {
      if (queue.offer(item)) {
        return true;
      }
    }
    currentMemory.addAndGet(-itemLength);
    return false;
  }
787655
public boolean removeObject (Object object)
    {
        for (int i = 0; i < _size; i++) {
            if (_records[i].object == object) {
                // shift everything down
                System.arraycopy(_records, i+1, _records, i, _size-(i+1));
                // clear out the trailing reference
                _records[--_size] = null;
                return true;
            }
        }

        return false;
    }
701874
public Element<T> find( T object ) {
		Element<T> e = first;
		while( e != null ) {
			if( e.object == object ) {
				return e;
			}
			e = e.next;
		}
		return null;
	}
1023068
private void putToCache(final Element element, final Constraint object) {
		String id = element.getAttributeValue(XMLTags.ID);
		if (id != null && id.length() > 0) {
			Constraint old = putToCache(id, object);
			if (old != null) {
				LOG.warn("The id=" + id + " for object of type=" + old.getClass().getName()
						+ " was already found. Please make sure this is ok and no mistake.");
			}
		}
	}
570005
public IndexCommitBuilder insert(Object object) {
        updateModelClassSet(object);
        getInsertList(object.getClass()).add((OpenEngSBModel) object);
        return this;
    }
104455
public boolean tryEnter(Object obj) {
    if (entered.containsKey(obj)) {
      return false;
    } else {
      entered.put(obj, null);
      return true;
    }
  }
406315
public boolean insert(int newIndex) {
        // Ignore objects which do not belong in this quad tree
        INDArray point = data.slice(newIndex);
        if (!boundary.containsPoint(point))
            return false;

        cumSize++;
        double mult1 = (double) (cumSize - 1) / (double) cumSize;
        double mult2 = 1.0 / (double) cumSize;

        centerOfMass.muli(mult1);
        centerOfMass.addi(point.mul(mult2));

        // If there is space in this quad tree and it is a leaf, add the object here
        if (isLeaf() && size < QT_NODE_CAPACITY) {
            index[size] = newIndex;
            size++;
            return true;
        }

        //duplicate point
        if (size > 0) {
            for (int i = 0; i < size; i++) {
                INDArray compPoint = data.slice(index[i]);
                if (point.getDouble(0) == compPoint.getDouble(0) && point.getDouble(1) == compPoint.getDouble(1))
                    return true;
            }
        }



        // If this Node has already been subdivided just add the elements to the
        // appropriate cell
        if (!isLeaf()) {
            QuadTree index = findIndex(point);
            index.insert(newIndex);
            return true;
        }

        if (isLeaf())
            subDivide();

        boolean ret = insertIntoOneOf(newIndex);



        return ret;
    }
1362146
@Override
    public Object put(Object object) {
        Object returnVal = null;
        long currentTime = CHFWBundle.getApproxTime();

        synchronized (this) {
            // get next free position, or oldest position if none free
            lastEntry++;
            // If last entry is past end of array, go back to the beginning
            if (lastEntry == poolSize) {
                lastEntry = 0;
            }
            returnVal = free[lastEntry]; // get whatever was in that slot for return
                                         // value
            free[lastEntry] = object;
            timeFreed[lastEntry] = currentTime;
            // if we overlaid the first/oldest entry, reset the first entry position
            if (lastEntry == firstEntry) {
                firstEntry++;
                if (firstEntry == poolSize) {
                    firstEntry = 0;
                }
            }
            if (firstEntry == -1) { // if pool was empty before, this is first entry now
                firstEntry = lastEntry; // should always be at '0', this may
                                        // overwrite the oldest entry, in which case
                                        // the oldest one will be garbage collected
            }

            if (returnVal != null && destroyer != null) { // @PK36998A
                destroyer.destroy(returnVal);
            }

            // check timestamp of oldest entry, and delete if older than 60 seconds
            // we should do a batch cleanup of all pools based on a timer rather than
            // waiting for a buffer to be released to trigger it, maybe in the next
            // release
            if (cleanUpOld) {
                while (firstEntry != lastEntry) {
                    if (currentTime > (timeFreed[firstEntry] + 60000L)) {
                        if (destroyer != null && free[firstEntry] != null) { // @PK36998A
                            destroyer.destroy(free[firstEntry]);
                        }
                        free[firstEntry] = null;
                        firstEntry++;
                        if (firstEntry == poolSize) {
                            firstEntry = 0;
                        }
                    } else
                        break;
                }
            }
        }
        return returnVal;
    }
997370
public boolean put(T object) {
        if (object == null) {
            throw new IllegalArgumentException("returning null object to pool");
        }

        while (true) {
            // 1. get the index of the next free cell
            int g = m_get.get();
            int p = m_put.get();
            if (p >= LIMIT) {
                // this happens very seldom - once every 1**31 calls, the put
                // index completes a full cycle.
                // to handle this simply, we just wait for the pool to
                // drain, and start placing objects back in the pool only when
                // the get index completes its cycle too.
                return false;
            }
            if (p - g >= (m_arraySize - 1)) {
                // put index is far from the get pointer, implying full pool.
                // note that (p >= g + m_capacity) is a bug.
                return false;
            }

            // 2. conquer this cell by incrementing the put index
            if (!m_put.compareAndSet(p, p + 1)) {
                // some other thread got here first. try again.
                continue;
            }

            // 3. put the object in the cell
            int index = p % m_arraySize;
            AtomicReference<T> reference = m_array[index];
            if (reference.compareAndSet(null, object)) {
                return true;
            }

            // getting here is rare. the object that was supposedly conquered
            // locally was replaced with a different object in the same cell.
        }
    }
1361483
public MergeObservableList<T> insertItem(T object) {
        lists.add(Collections.singletonList(object));
        modCount += 1;
        listeners.notifyInserted(this, size() - 1, 1);
        return this;
    }
1327424
public final boolean add(Object key
                    )
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass
                        , "add"
                        , "key=" + key + "(Object)"
                            );

        boolean found = false;
        java.util.Set subSet = getSubSet(key);
        synchronized (subSet) {
            found = subSet.add(key);
        } // synchronized (subSet).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "add"
                       , "returns found=" + found + "(boolean)"
                            );
        return found;
    }
1368395
public void onReceive(Object object) {
		if (!closed && object != null) {
			synchronized (queue) {
				queue.addLast(object);
				if (limit > 0 && queue.size() > limit && !queue.isEmpty()) {
					queue.removeFirst();
				}
			}
		}
	}