1 package uk.co.jezuk.mango; 2 3 import uk.co.jezuk.mango.iterators.*; 4 5 11 public class Iterators 12 { 13 17 static public java.util.Iterator StringIterator(String s) { return new uk.co.jezuk.mango.iterators.StringIterator(s); } 18 19 23 static public java.util.Iterator NullIterator() { return new uk.co.jezuk.mango.iterators.NullIterator(); } 24 25 39 static public java.util.Iterator BoundedIterator(java.util.Iterator iterator, int start, int end) { return new BoundedIterator(iterator, start, end); } 40 static public java.util.Iterator BoundedIterator(java.util.List list, int start, int end) { return new BoundedIterator(list, start, end); } 41 42 45 static public java.util.Iterator PredicatedIterator(java.util.Iterator iterator, Predicate predicate) { return SelectingIterator(iterator, predicate); } 46 47 69 static public java.util.Iterator SelectingIterator(java.util.Iterator iterator, Predicate predicate) { return new SelectingIterator(iterator, predicate); } 70 71 80 static public java.util.Iterator SkippingIterator(java.util.Iterator iterator, Predicate predicate) { return new SkippingIterator(iterator, predicate); } 81 82 88 static public java.util.Iterator ArrayIterator(Object [] array) { return new ArrayIterator(array); } 89 90 98 static public java.util.Iterator SingletonIterator(Object object) { return new SingletonIterator(object); } 99 100 127 static public java.util.Iterator TransformIterator(java.util.Iterator iterator, UnaryFunction transform) { return new TransformIterator(iterator, transform); } 128 129 private Iterators() { } 131 } | Popular Tags |