| Method from org.apache.commons.pool.impl.CursorableLinkedList$Cursor Detail: |
public void add(Object o) {
checkForComod();
Listable elt = insertListable(_cur.prev(),_cur.next(),o);
_cur.setPrev(elt);
_cur.setNext(elt.next());
_lastReturned = null;
_nextIndex++;
_expectedModCount++;
}
|
protected void checkForComod() {
if(!_valid) {
throw new ConcurrentModificationException();
}
}
|
public void close() {
if(_valid) {
_valid = false;
unregisterCursor(this);
}
}
Mark this cursor as no longer being needed. Any resources
associated with this cursor are immediately released.
In previous versions of this class, it was mandatory to close
all cursor objects to avoid memory leaks. It is no longer
necessary to call this close method; an instance of this class
can now be treated exactly like a normal iterator. |
protected void invalidate() {
_valid = false;
}
|
protected void listableChanged(CursorableLinkedList.Listable elt) {
if(_lastReturned == elt) {
_lastReturned = null;
}
}
|
protected void listableInserted(CursorableLinkedList.Listable elt) {
if(null == _cur.next() && null == _cur.prev()) {
_cur.setNext(elt);
} else if(_cur.prev() == elt.prev()) {
_cur.setNext(elt);
}
if(_cur.next() == elt.next()) {
_cur.setPrev(elt);
}
if(_lastReturned == elt) {
_lastReturned = null;
}
}
|
protected void listableRemoved(CursorableLinkedList.Listable elt) {
if(null == _head.prev()) {
_cur.setNext(null);
} else if(_cur.next() == elt) {
_cur.setNext(elt.next());
}
if(null == _head.next()) {
_cur.setPrev(null);
} else if(_cur.prev() == elt) {
_cur.setPrev(elt.prev());
}
if(_lastReturned == elt) {
_lastReturned = null;
}
}
|
public int nextIndex() {
throw new UnsupportedOperationException();
}
|
public int previousIndex() {
throw new UnsupportedOperationException();
}
|