1 17 package org.apache.commons.collections.primitives.adapters; 18 19 import java.util.ListIterator ; 20 21 import org.apache.commons.collections.primitives.BooleanListIterator; 22 23 35 public class BooleanListIteratorListIterator implements ListIterator { 36 37 49 public static ListIterator wrap(BooleanListIterator iterator) { 50 return null == iterator ? null : new BooleanListIteratorListIterator(iterator); 51 } 52 53 58 public BooleanListIteratorListIterator(BooleanListIterator iterator) { 59 _iterator = iterator; 60 } 61 62 public int nextIndex() { 63 return _iterator.nextIndex(); 64 } 65 66 public int previousIndex() { 67 return _iterator.previousIndex(); 68 } 69 70 public boolean hasNext() { 71 return _iterator.hasNext(); 72 } 73 74 public boolean hasPrevious() { 75 return _iterator.hasPrevious(); 76 } 77 78 public Object next() { 79 return new Boolean (_iterator.next()); 80 } 81 82 public Object previous() { 83 return new Boolean (_iterator.previous()); 84 } 85 86 public void add(Object obj) { 87 _iterator.add(((Boolean )obj).booleanValue()); 88 } 89 90 public void set(Object obj) { 91 _iterator.set(((Boolean )obj).booleanValue()); 92 } 93 94 public void remove() { 95 _iterator.remove(); 96 } 97 98 private BooleanListIterator _iterator = null; 99 100 } 101 | Popular Tags |