Inserts the supplied object into the set.

@return true if it was inserted, false if the object was already in
the set.
549382
public boolean insert (ObjectInfo info)
    {
        // bail if it's already in the set
        int ipos = indexOf(info);
        if (ipos >= 0) {
            // log a warning because the caller shouldn't be doing this
            log.warning("Requested to add an object to a set that already " +
                        "contains such an object [ninfo=" + info +
                        ", oinfo=" + _objs[ipos] + "].", new Exception());
            return false;
        }

        // otherwise insert it
        ipos = -(ipos+1);
        _objs = ListUtil.insert(_objs, ipos, info);
        _size++;
        return true;
    }
838560
@Override
    public boolean add(E e) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            Object[] elements = getArray();
            int len = elements.length;
            Object[] newElements = Arrays.copyOf(elements, len + 1);
            newElements[len] = e;
            setArray(newElements);
            return true;
        } finally {
            lock.unlock();
        }
    }
827552
public boolean add() {
        if (root == NIL) {
            root = nodeAllocator.newNode();
            copy(root);
            fixAggregates(root);
            return true;
        } else {
            int node = root; assert parent(root) == NIL;
            int parent;
            int cmp;
            do {
                cmp = compare(node);
                if (cmp < 0) {
                    parent = node;
                    node = left(node);
                } else if (cmp > 0) {
                    parent = node;
                    node = right(node);
                } else {
                    merge(node);
                    return false;
                }
            } while (node != NIL);

            node = nodeAllocator.newNode();
            if (node >= capacity()) {
                resize(oversize(node + 1));
            }
            copy(node);
            parent(node, parent);
            if (cmp < 0) {
                left(parent, node);
            } else {
                assert cmp > 0;
                right(parent, node);
            }

            rebalance(node);

            return true;
        }
    }
869069
public boolean put(PutAction putAction) {
    HTableInterface table = pool.getTable(tableName);
    try {
      return put(putAction, table);
    } finally {
      if (table != null) {
        try {
          table.close();
        } catch (IOException e) {
          throw new DatasetIOException("Error putting table back into pool", e);
        }
      }
    }
  }
980983
public boolean addIfAbsent(E e) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            // Copy while checking if already present.
            // This wins in the most common case where it is not present
            Object[] elements = getArray();
            int len = elements.length;
            Object[] newElements = new Object[len + 1];
            for (int i = 0; i < len; ++i) {
                if (eq(e, elements[i]))
                    return false; // exit, throwing away copy
                else
                    newElements[i] = elements[i];
            }
            newElements[len] = e;
            setArray(newElements);
            return true;
        } finally {
            lock.unlock();
        }
    }
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.
        }
    }
22525
private boolean insert(T element) {
        if (!entries.containsKey(element)) {
            head = createEntry(element, head);
            entries.put(element, head);
            return true;
        }
        return false;
    }
509503
public boolean add(final K key, final V value) {
        if (!this.map.containsKey(key)) {
            this.map.put(key, new ArrayList<V>());
        }
        return this.map.get(key).add(value);
    }
577869
@Override
	public boolean add(T newElement) {
		elements[lastIndex] = newElement;
		lastIndex = incrementIndex(lastIndex, 0);
		if (isEmpty()) {
			// First element
			firstIndex = 0;
			size = 1;
		} else if (isFull()) {
			// Reuse space
			firstIndex = lastIndex;
		} else {
			size = incrementIndex(size, elements.length);
		}
		return true;
	}
1060897
public boolean objectAdded (DEvent event, DObject target)
    {
        ObjectAddedEvent oae = (ObjectAddedEvent)event;
        int oid = oae.getOid();

        // ensure that the target object exists
        if (!_objects.containsKey(oid)) {
            log.info("Rejecting object added event of non-existent object",
                     "refferOid", target.getOid(), "reffedOid", oid);
            return false;
        }

        // get the reference vector for the referenced object. we use bare arrays rather than
        // something like an array list to conserve memory. there will be many objects and
        // references
        Reference[] refs = _refs.get(oid);
        if (refs == null) {
            refs = new Reference[DEFREFVEC_SIZE];
            _refs.put(oid, refs);
        }

        // determine where to add the reference
        Reference ref = new Reference(target.getOid(), oae.getName(), oid);
        int rpos = -1;
        for (int ii = 0; ii < refs.length; ii++) {
            if (ref.equals(refs[ii])) {
                log.warning("Ignoring request to track existing reference " + ref + ".");
                return true;
            } else if (refs[ii] == null && rpos == -1) {
                rpos = ii;
            }
        }

        // expand the refvec if necessary
        if (rpos == -1) {
            Reference[] nrefs = new Reference[refs.length*2];
            System.arraycopy(refs, 0, nrefs, 0, refs.length);
            rpos = refs.length;
            _refs.put(oid, refs = nrefs);
        }

        // finally add the reference
        refs[rpos] = ref;

//        log.info("Tracked reference " + ref + ".");
        return true;
    }
51666
public boolean add(Object obj) {
        if (obj == null) {
            obj = NULL;
        }

        Entry tab[] = mTable;
        int hash = hashCode(obj);
        int index = (hash & 0x7FFFFFFF) % tab.length;

        for (Entry e = tab[index], prev = null; e != null; e = e.mNext) {
            Object iobj = e.get();
            if (iobj == null) {
                // Clean up after a cleared Reference.
                if (prev != null) {
                    prev.mNext = e.mNext;
                }
                else {
                    tab[index] = e.mNext;
                }
                mCount--;
            }
            else if (e.mHash == hash &&
                     obj.getClass() == iobj.getClass() &&
                     equals(obj, iobj)) {
                // Already in set.
                return false;
            }
            else {
                prev = e;
            }
        }

        if (mCount >= mThreshold) {
            // Cleanup the table if the threshold is exceeded.
            cleanup();
        }

        if (mCount >= mThreshold) {
            // Rehash the table if the threshold is still exceeded.
            rehash();
            tab = mTable;
            index = (hash & 0x7FFFFFFF) % tab.length;
        }

        // Create a new entry.
        tab[index] = new Entry((obj == NULL ? new Null() : obj), hash, tab[index]);
        mCount++;
        return true;
    }
1342002
public boolean add(int i) {
      boolean wasSet = bitSet.get(i);
      if (!wasSet) {
         bitSet.set(i);
         return true;
      }
      return false;
   }
313394
private boolean isAlwaysInserted(JDBCStorableProperty<?> property) {
        return property.isVersion() ? (mVersioning == Versioning.AUTO) : !property.isAutomatic();
    }
586712
public void add(T newValue) {
		if (this.isSet) {
			if (!this.isMultiple
					&& newValue != this.object && (newValue == null || !newValue.equals(this.object))) {
				this.isMultiple = true;
				this.object = null;
			}
		} else {
			this.object = newValue;
			this.isSet = true;
			this.isMultiple = false;
		}
	}
101809
@Override
    // TODO: what happens if pushAll and key already exists?
    public Object put(Object key, Object value) {
        verifyOperation($set);

        return updates.put(getKeyForUpdate(key), DBObjectUtil.toDBObject(value));
    }
39668
public boolean put(T t) {
        if (initial) {
            if (size == data.length) {
                if (size < limit * 2) {
                    @SuppressWarnings("unchecked")
                    T[] newData = (T[]) new Object[Math.min(limit, size) * 2];
                    System.arraycopy(data, 0, newData, 0, size);
                    data = newData;
                } else {
                    Arrays.sort(data, comparator);
                    initial = false;
                    size = limit;
                }
                put(t);
            } else {
                data[size++] = t;
            }
            return true;
        }
        if (size == data.length) {
            sortTail();
        }
        if (comparator.compare(t, data[limit - 1]) < 0) {
            data[size++] = t;
            return true;
        }
        return false;
    }
1203575
function setadd(set, element) {
  if (set.has(element)) return false;
  set.add(element);
  return true;
}