public void set(Object obj) { if (obj == null) throw new NullPointerException("obj = null"); if (_last == null) throw new IllegalStateException(); Instruction ins = (Instruction) obj; ins.prev = _last.prev; ins.next = _last.next; ins.prev.next = ins; ins.next.prev = ins; replaceTarget(_last, ins); _last.invalidate(); if (_bn == _last) _bn = ins; _last = ins; invalidateByteIndexes(); }
public void set(Object obj) { if (obj == null) throw new NullPointerException("obj = null"); if (_last == null) throw new IllegalStateException(); Instruction ins = (Instruction) obj; ins.prev = _last.prev; ins.next = _last.next; ins.prev.next = ins; ins.next.prev = ins; replaceTarget(_last, ins); _last.invalidate(); if (_bn == _last) _bn = ins; _last = ins; invalidateByteIndexes(); }
public void remove() { if (_last == null) throw new IllegalStateException(); if (_bn == _last) _bn = _last.prev; _index--; _last.prev.next = _last.next; _last.next.prev = _last.prev; _size--; Instruction orig = _last; Instruction replace = null; if (orig.next != _tail) replace = (Instruction) orig.next; else replace = nop(); replaceTarget(orig, replace); orig.invalidate(); _last = null; invalidateByteIndexes(); }
public void remove() { if (_last == null) throw new IllegalStateException(); if (_bn == _last) _bn = _last.prev; _index--; _last.prev.next = _last.next; _last.next.prev = _last.prev; _size--; Instruction orig = _last; Instruction replace = null; if (orig.next != _tail) replace = (Instruction) orig.next; else replace = nop(); replaceTarget(orig, replace); orig.invalidate(); _last = null; invalidateByteIndexes(); }