/** * Appends the specified element to the end of this list. * * @param o element to be appended to this list. * @return <tt>true</tt> (as per the general contract of * <tt>Collection.add</tt>). */ public boolean add(T o) { addLast(o); return true; }
/** * Appends all of the elements in the specified collection to the end of * this list, in the order that they are returned by the specified * collection's iterator. The behavior of this operation is undefined if * the specified collection is modified while the operation is in * progress. (This implies that the behavior of this call is undefined if * the specified Collection is this list, and this list is nonempty.) * * @param c the elements to be inserted into this list. * @return <tt>true</tt> if this list changed as a result of the call. * @throws NullPointerException if the specified collection is null. */ public boolean addAll(Collection<? extends T> c) { for(Iterator<? extends T> it=c.iterator(); it.hasNext(); ) { addLast(it.next()); } return true; }