@Override @SuppressWarnings("unchecked") public Object set(int index, Object value) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } final Object old = isPutQueueEnabled() ? readElementByIndex( index ) : UNKNOWN; if ( old==UNKNOWN ) { write(); return list.set( index, value ); } else { queueOperation( new Set( index, value, old ) ); return old; } }
@Override @SuppressWarnings("unchecked") public void operate() { list.set( getIndex(), getAddedInstance() ); } }
/** * @see java.util.List#set(int, Object) */ public Object set(int index, Object value) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } Object old = isPutQueueEnabled() ? readElementByIndex( index ) : UNKNOWN; if ( old==UNKNOWN ) { write(); return list.set(index, value); } else { queueOperation( new Set(index, value, old) ); return old; } }
@Override @SuppressWarnings("unchecked") public E set(int index, E value) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } final E old = isPutQueueEnabled() ? readElementByIndex( index ) : (E) UNKNOWN; if ( old==UNKNOWN ) { write(); return list.set( index, value ); } else { queueOperation( new Set( index, value, old ) ); return old; } }
/** * @see java.util.List#set(int, Object) */ public Object set(int index, Object value) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } Object old = isPutQueueEnabled() ? readElementByIndex( index ) : UNKNOWN; if ( old==UNKNOWN ) { write(); return list.set(index, value); } else { queueOperation( new Set(index, value, old) ); return old; } }