/*
(non-Javadoc)

@see java.util.LinkedList#add(int, java.lang.Object)
424469
@Override
    public void add(int location, E object) {
        if (size() == maxSize) {
            removeFirst();
        }
        super.add(location, object);
    }
93390
private void addToList(List<Object> list, Object value) {
    if (value instanceof List) {
      list.addAll((List) value);
    } else {
      list.add(value);
    }
  }
956040
public void add(T value) {
        Element<T> element = new Element<T>(bundle, value);
        element.previous = tail;
        if (tail != null) tail.next = element;
        tail = element;
        if (head == null) head = element;
    }
480286
public void add(final T node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNext( node );
            node.setPrevious( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
912871
public void add(final ObjectSinkNode node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNextObjectSinkNode( node );
            node.setPreviousObjectSinkNode( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
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);
    }
795787
public final void addObject(Object object) {
        if (object instanceof Iterable) {
            // Iterable
            for (Object o : (Iterable<?>) object) {
                objects.add(o);
            }
        } else if (object.getClass().isArray()) {
            // Array
            for (Object o : (Object[]) object) {
                objects.add(o);
            }
        } else {
            // Single object
            objects.add(object);
        }
    }
1102846
@Override
	public void add(int index, ST segment) {
		if (index < 0 || index > this.segmentList.size()) {
			throw new IndexOutOfBoundsException();
		}
		// The path is empty, so that the segment is the first one.
		if (this.segmentList.isEmpty()) {
			if (this.segmentList.add(segment)) {
				this.startingPoint = segment.getBeginPoint();
				this.endingPoint = segment.getEndPoint();
				this.length += segment.getLength();
				return;
			}
			throw new IllegalArgumentException();
		}

		// Detect the candidates to the connection
		final PT candidate;

		this.isReversable = false;

		if (index < this.segmentList.size()) {
			candidate = getStartingPointFor(index);
		} else {
			candidate = this.endingPoint;
		}

		// Check the connection validity
		if (candidate != null) {
			final PT first = segment.getBeginPoint();
			final PT last = segment.getEndPoint();
			if (index == 0 && (candidate.equals(first) || candidate.equals(last))) {
				this.segmentList.add(0, segment);
				this.startingPoint = segment.getOtherSidePoint(this.startingPoint);
				this.length += segment.getLength();
				return;
			} else if (index == this.segmentList.size() && (candidate.equals(first) || candidate.equals(last))) {
				this.segmentList.add(segment);
				this.endingPoint = segment.getOtherSidePoint(this.endingPoint);
				this.length += segment.getLength();
				return;
			} else if (candidate.equals(first) || candidate.equals(last)) {
				this.segmentList.add(index, segment);
				this.length += segment.getLength();
				return;
			}
		}

		throw new IllegalArgumentException();
	}
1205422
public void add(K key, V value)
  {
    if (key == null) {
      return;
    }

    K []keys = _keys;
    final int size = _size;
    
    for (int i = size - 1; i >= 0; i--) {
      if (key.equals(keys[i])) {
        _values[i].add(value);
        return;
      }
    }

    if (! ensureCapacity(size)) {
      return;
    }
    
    _keys[size] = key;
    _values[size] = new ArrayList<V>();
    _values[size].add(value);
    
    _size = size + 1;
  }
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;
                }
            }
        }
    }
708534
@SuppressWarnings("unchecked")
	public T add(Link... links) {

		Assert.notNull(links, "Given links must not be null!");

		add(Arrays.asList(links));

		return (T) this;
	}
7383
public boolean add(Object o) {
		try {
			this.addElement((Element) o);
			return true;
		}
		catch(ClassCastException cce) {
			throw new ClassCastException("You can only add objects that implement the Element interface.");
		}
		catch(BadElementException bee) {
			throw new ClassCastException(bee.getMessage());
		}
	}
1033964
public void add( int value ) {
		// see if it needs to grow the queue
		if( size >= data.length) {
			int a[] = new int[ nextDataSize() ];

			System.arraycopy(data,start,a,0,data.length-start);
			System.arraycopy(data,0,a,data.length-start,start);
			start = 0;
			data = a;
		}
		data[(start+size)%data.length] = value;
		size++;
	}
716881
public void addition(E entry) {
        if (additions==null) additions = new ArrayList<E>();
        additions.add(entry);
    }
155156
public void add(Object key, Object value) {
        Object existing = mMap.get(key);
        if (existing instanceof List) {
            if (value instanceof List) {
                ((List)existing).addAll((List)value);
            }
            else {
                ((List)existing).add(value);
            }
        }
        else if (existing == null && !mMap.containsKey(key)) {
            if (value instanceof List) {
                mMap.put(key, new ArrayList((List)value));
            }
            else {
                mMap.put(key, value);
            }
        }
        else {
            List list = new ArrayList();
            list.add(existing);
            if (value instanceof List) {
                list.addAll((List)value);
            }
            else {
                list.add(value);
            }
            mMap.put(key, list);
        }
    }
1322448
public void add(Binding binding) {
	if (values == null) values = new LinkedList();
	values.add(binding);
    }
391430
public void addAll( List<T> list ) {
		if( list.isEmpty() )
			return;

		Element<T> a = requestNew();
		a.object = list.get(0);

		if( first == null ) {
			first = a;
		} else if( last != null ) {
			last.next = a;
			a.previous = last;
		}

		for (int i = 1; i < list.size(); i++) {
			Element<T> b = requestNew();
			b.object = list.get(i);

			a.next = b;
			b.previous = a;
			a = b;
		}

		last = a;
		size += list.size();
	}