Inserts an element with given timestamp, waiting for space to become available
if the timestamp of the element minus the current timestamp of the queue exceeds
the queue capacity.

@param e an element.
@param timeStamp the timestamp of {@code e}.
439364
public void put(final E e, final long timeStamp) throws InterruptedException {
		final ReentrantLock lock = this.lock;
		lock.lockInterruptibly();
		try {
			// mask is a.length - 1
			while(timeStamp - this.timeStamp > mask) newSpaceAvailable.await();
			final int timeOffset = (int)(timeStamp - this.timeStamp);
			assert a[start + timeOffset & mask] == null : a[start + timeOffset & mask];
			a[start + timeOffset & mask] = e;
			++count;
			if (timeOffset == 0) nextObjectReady.signal();
		}
		finally {
			lock.unlock();
		}
	}
1074388
public synchronized void addElement(@NonNull T element) {
        hashCached = false;
        this.elementsMap.put(element.getLabel(), element);
        this.elements.add(element);
    }
343312
public synchronized void insert(XEvent event, int index)
			throws IndexOutOfBoundsException, IOException {
		if (index < 0 || index > size) {
			throw new IndexOutOfBoundsException();
		}
		// check if we can append
		if (index == size) {
			append(event);
			return;
		}
		// adjust size and overflow size
		size++;
		overflowSize++;
		// add to overflow set
		for (int i = overflowSize - 2; i >= 0; i--) {
			if (overflowIndices[i] >= index) {
				overflowIndices[i + 1] = overflowIndices[i] + 1;
				overflowEntries[i + 1] = overflowEntries[i];
			} else {
				overflowIndices[i + 1] = index;
				overflowEntries[i + 1] = event;
				if (overflowSize == overflowIndices.length) {
					consolidate();
				}
				return;
			}
		}
		// if we arrive here, we must insert at zero
		overflowIndices[0] = index;
		overflowEntries[0] = event;
		if (overflowSize == overflowIndices.length) {
			consolidate();
		}
	}
254530
@Override
	public boolean add(E e) {
		if (capacity <= linkedBlockingDeque.size())
			linkedBlockingDeque.removeFirst();
		return linkedBlockingDeque.add(e);
	}
819818
private boolean add(T e, boolean failWhenFull) {
        final Queue<T> queue = this.getOrCreateQueue(e);

        this.writeLock.lock();
        try {
            if (this.size == this.capacity) {
                if (failWhenFull) {
                    throw new IllegalStateException("Queue is at capacity: " + this.capacity);
                }

                return false;
            }

            final boolean added = queue.add(e);
            if (added) {
                this.size++;
                this.notEmpty.signal();
            }
            return added;
        } finally {
            this.writeLock.unlock();
        }
    }
190475
private static <U, T extends TimePoint<U, T>> T add(
        TimePoint<U, T> context,
        ChronoElement<?> element,
        boolean forward
    ) {

        U unit = context.getChronology().getBaseUnit(element);

        if (forward) {
            return context.plus(1, unit);
        } else {
            return context.minus(1, unit);
        }

    }
111462
public void addFirst(E e) {
        if (e == null)
            throw new NullPointerException();
        elements[head = (head - 1) & (elements.length - 1)] = e;
        if (head == tail)
            doubleCapacity();
    }
197327
void put(ChronoElement<?> element, int v) {

        if (element == null) {
            throw new NullPointerException();
        }

        Map<ChronoElement<?>, Object> m = this.map;
        if (m == null) {
            m = new HashMap<>();
            this.map = m;
        }
        m.put(element, Integer.valueOf(v));

    }
1225795
public void setTime(String timeString)
    {
		Date time = null;
		try	{
            if ((timeString != null) && (timeString.length() > 0))
                time = timeFormat.parse(timeString);
		} catch (Exception e)	{
            time = null;
		}
        this.setTime(time);
    }
1133618
public final void insert(final int i, final int[] e) {
        final int l = e.length;
        if (l == 0) return;
        if (size + l > list.length) list = Arrays.copyOf(list, newSize(size + l));
        Array.move(list, i, l, size - i);
        System.arraycopy(e, 0, list, i, l);
        size += l;
    }
50936
public void add(long timestamp, T object) {
		JMMap.getOrPutGetNew(this.timeSeriesMap, buildKeyTimestamp(timestamp),
				ArrayList::new).add(object);
	}
786283
public void setTimestamp(String timestamp) throws ParseException {
        this.analysisTimestamp = new SimpleDateFormat(TIMESTAMP_FORMAT, Locale.ENGLISH).parse(timestamp);
    }
32594
public void add(KType e1, KType e2) {
    ensureBufferSpace(2);
    buffer[elementsCount++] = e1;
    buffer[elementsCount++] = e2;
  }
888762
public void add(E element) {
        if (element == null) throw new NullPointerException();

        if (root == null) {
            root = new MutableNode<>(element);
        } else {
            MutableNode<E> node = root;
            while (!node.getElement().equals(element)) {
                int distance = distance(node.getElement(), element);

                MutableNode<E> parent = node;
                node = parent.childrenByDistance.get(distance);
                if (node == null) {
                    node = new MutableNode<>(element);
                    parent.childrenByDistance.put(distance, node);
                    break;
                }
            }
        }
    }
448817
public static boolean isUnixTimeStamp(String timeStamp) {
    if (timeStamp.length() != ComplianceConfigurationKeys.TIME_STAMP_LENGTH) {
      return false;
    }
    try {
      Long.parseLong(timeStamp);
      return true;
    } catch (NumberFormatException e) {
      return false;
    }
  }
184354
public void add(final int[] e) {
        if (size == list.length) list = Array.copyOf(list, newSize());
        list[size++] = e;
    }
1304268
private final void insert(T t) {
        buffer[putIndex] = t;

        if (++putIndex >= buffer.length) {
            putIndex = 0;
        }
    }