예제 #1
0
 public static FastIterator valueOf(FastCollection collection) {
   FastIterator iterator = (FastIterator) FastIterator.FACTORY.object();
   iterator._collection = collection;
   iterator._next = collection.head().getNext();
   iterator._tail = collection.tail();
   return iterator;
 }
예제 #2
0
 public void remove() {
   if (_current != null) {
     // Uses the previous record (not affected by the remove)
     // to set the next record.
     final Record previous = _current.getPrevious();
     _collection.delete(_current);
     _current = null;
     _next = previous.getNext();
   } else {
     throw new IllegalStateException();
   }
 }
예제 #3
0
 public Object next() {
   if (_next == _tail) throw new NoSuchElementException();
   _current = _next;
   _next = _next.getNext();
   return _collection.valueOf(_current);
 }