/** * Returns a list iterator over the elements in this list (in proper * sequence), starting at the specified position in the list. */ @Override public ListIterator<E> listIterator(int index) { rangeCheck(index); return new ListItr(index); }
/** * Creates new composite enumeration with provided enumerations. */ public CompositeEnumeration(Enumeration<T>... enumerations) { for (Enumeration<T> enumeration : enumerations) { add(enumeration); } }
/** * Creates new composite iterator with provided iterators. */ public CompositeIterator(Iterator<T>... iterators) { for (Iterator<T> iterator : iterators) { add(iterator); } }
@Override public void clear() { IntHashMap.this.clear(); } };
public Object setValue(Object obj) { setAttribute(key, obj); return value; } });
/** * Inserts all array elements to this list. */ public boolean addAll(int index, E... array) { rangeCheck(index); return doAddAll(index, array); }
/** * Removes last element of the list. */ public E removeLast() { return remove(size - 1); }
/** * Removes from this list all of its elements that are contained in the * specified collection. */ @Override public boolean removeAll(Collection<?> c) { return batchRemove(c, false); }
/** * Returns the element at the specified position in this list. */ public int get(int index) { checkRange(index); return array[index]; }
/** * Appends element to the list. */ public boolean addLast(E e) { return add(e); }
/** * Returns a value associated to a key in thread-safe way. */ public synchronized V get(Class key) { return unsafeGet(key); }
/** * Appends the specified element to the end of this list. */ public void add(int element) { ensureCapacity(size + 1); array[size++] = element; }
/** * Constructs an empty list with the specified initial capacity. */ public JoddArrayList(int initialCapacity) { init(initialCapacity); }
/** * Returns <code>true</code> if this list contains the specified element. */ @Override public boolean contains(Object o) { return indexOf(o) >= 0; }
/** * Appends all elements of given array. */ public boolean addAll(E... array) { if (array.length == 0) { return false; } return doAddAll(array); }
/** * Returns a list iterator over the elements in this list (in proper * sequence). * @see #listIterator(int) */ @Override public ListIterator<E> listIterator() { return new ListItr(0); }
/** * Returns the element at the specified position in this list. */ @Override @SuppressWarnings("unchecked") public E get(int index) { rangeCheck(index); return (E) buffer[start + index]; }
@Override public void clear() { IntHashMap.this.clear(); } };
/** * Removes first element of the list. */ public E removeFirst() { return remove(0); }
/** * Retains only the elements in this list that are contained in the * specified collection. In other words, removes from this list all * of its elements that are not contained in the specified collection. */ @Override public boolean retainAll(Collection<?> c) { return batchRemove(c, true); }