@Override public void push(final boolean o) { add(o); } @Override
@Override public void add(final boolean k) { AbstractBooleanList.this.add(pos++, k); last = -1; } @Override
/** * {@inheritDoc} * * <p> * This implementation delegates to the type-specific version of * {@link List#add(int, Object)}. */ @Override public boolean add(final boolean k) { add(size(), k); return true; } /**
/** * Adds all of the elements in the specified collection to this list (optional * operation). */ @Override public boolean addAll(int index, final Collection<? extends Boolean> c) { ensureIndex(index); final Iterator<? extends Boolean> i = c.iterator(); final boolean retVal = i.hasNext(); while (i.hasNext()) add(index++, (i.next()).booleanValue()); return retVal; } /**
/** * {@inheritDoc} * * <p> * This is a trivial iterator-based implementation. It is expected that * implementations will override this method with a more optimized version. */ @Override public void addElements(int index, final boolean a[], int offset, int length) { ensureIndex(index); if (offset < 0) throw new ArrayIndexOutOfBoundsException("Offset (" + offset + ") is negative"); if (offset + length > a.length) throw new ArrayIndexOutOfBoundsException( "End index (" + (offset + length) + ") is greater than array length (" + a.length + ")"); while (length-- != 0) add(index++, a[offset++]); } /**
@Override public void size(final int size) { int i = size(); if (size > i) while (i++ < size) add((false)); else while (i-- != size) removeBoolean(i); } @Override
@Override public boolean addAll(int index, final BooleanCollection c) { ensureIndex(index); final BooleanIterator i = c.iterator(); final boolean retVal = i.hasNext(); while (i.hasNext()) add(index++, i.nextBoolean()); return retVal; } /**