/** * Inserts the given element at the beginning of this list. * * @param o the element to be inserted at the beginning of this list. */ public void addFirst(T o) { insertElement(0, o); }
/** * Inserts the specified element at the specified position in this list. * Shifts the element currently at that position (if any) and any * subsequent elements to the right (adds one to their indices). * * @param index index at which the specified element is to be inserted. * @param element element to be inserted. * * @throws IndexOutOfBoundsException if the specified index is out of * range (<tt>index < 0 || index > size()</tt>). */ public void add(int index, T element) { insertElement(index, element); }
/** * Inserts all of the elements in the specified collection into this * list, starting at the specified position. * * @param index index at which to insert first element * from the specified collection. * @param c elements to be inserted into this list. * @return <tt>true</tt> if this list changed as a result of the call. * @throws IndexOutOfBoundsException if the specified index is out of * range (<tt>index < 0 || index > size()</tt>). * @throws NullPointerException if the specified collection is null. */ public boolean addAll(int index, Collection<? extends T> c) { for(Iterator<? extends T> it=c.iterator(); it.hasNext(); ) { int idx = insertElement(index, it.next()); if(idx<=index) index++; } return true; }
/** * Appends the given element to the end of this list. (Identical in * function to the <tt>add</tt> method; included only for consistency.) * * @param o the element to be inserted at the end of this list. */ public void addLast(T o) { insertElement(size(), o); }
int index = orders.insertElement( order==ASC ? orders.size() : 0, orderexp.getValue(f2));