@Override @SuppressWarnings("unchecked") public Object get(int index) { if ( index < 0 ) { throw new ArrayIndexOutOfBoundsException( "negative index" ); } final Object result = readElementByIndex( index ); return result == UNKNOWN ? list.get( index ) : result; }
@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 Object remove(int index) { if ( index < 0 ) { throw new ArrayIndexOutOfBoundsException( "negative index" ); } final Object old = isPutQueueEnabled() ? readElementByIndex( index ) : UNKNOWN; elementRemoved = true; if ( old == UNKNOWN ) { write(); dirty(); return list.remove( index ); } else { queueOperation( new Remove( index, old ) ); return old; } }
@Override @SuppressWarnings("unchecked") public E get(int index) { if ( index < 0 ) { throw new ArrayIndexOutOfBoundsException( "negative index" ); } final E result = readElementByIndex( index ); return result == UNKNOWN ? list.get( index ) : result; }
/** * @see java.util.List#get(int) */ public Object get(int index) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } Object result = readElementByIndex( index ); return result==UNKNOWN ? list.get(index) : result; }
/** * @see java.util.List#get(int) */ public Object get(int index) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } Object result = readElementByIndex( index ); return result==UNKNOWN ? list.get(index) : result; }
@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; } }
/** * @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; } }
/** * @see java.util.List#remove(int) */ public Object remove(int index) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } Object old = isPutQueueEnabled() ? readElementByIndex( index ) : UNKNOWN; if ( old==UNKNOWN ) { write(); return list.remove(index); } else { queueOperation( new Remove(index, old) ); return old; } }
/** * @see java.util.List#remove(int) */ public Object remove(int index) { if (index<0) { throw new ArrayIndexOutOfBoundsException("negative index"); } Object old = isPutQueueEnabled() ? readElementByIndex( index ) : UNKNOWN; if ( old==UNKNOWN ) { write(); return list.remove(index); } else { queueOperation( new Remove(index, old) ); return old; } }
@Override @SuppressWarnings("unchecked") public E remove(int index) { if ( index < 0 ) { throw new ArrayIndexOutOfBoundsException( "negative index" ); } final Object old = isPutQueueEnabled() ? readElementByIndex( index ) : UNKNOWN; elementRemoved = true; if ( old == UNKNOWN ) { write(); dirty(); return list.remove( index ); } else { queueOperation( new Remove( index, old ) ); return (E) old; } }