Package org.organicdesign.fp.collections
Interface UnmodSortedIterable<T>
-
- All Superinterfaces:
java.lang.Iterable<T>,Transformable<T>,UnmodIterable<T>
- All Known Subinterfaces:
BaseList<E>,ImList<E>,ImSortedMap<K,V>,ImSortedSet<E>,MutableList<E>,UnmodList<E>,UnmodSortedCollection<E>,UnmodSortedMap<K,V>,UnmodSortedSet<E>
- All Known Implementing Classes:
PersistentTreeMap,PersistentTreeSet,PersistentVector,PersistentVector.MutableVector,RangeOfInt,RrbTree,RrbTree.ImRrbt,RrbTree.MutableRrbt,UnmodList.AbstractUnmodList
public interface UnmodSortedIterable<T> extends UnmodIterable<T>
An unmodifiable Iterable, with guaranteed order. The signature of this interface is nearly identical to UnmodIterable, but implementing this interface represents a contract to always return iterators that have the same ordering.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <E> UnmodSortedIterable<E>castFromList(java.util.List<E> s)static <K,V>
UnmodSortedIterable<UnmodMap.UnEntry<K,V>>castFromSortedMap(java.util.SortedMap<K,V> sm)static <E> UnmodSortedIterable<E>castFromSortedSet(java.util.SortedSet<E> s)static booleanequal(UnmodSortedIterable a, UnmodSortedIterable b)This is correct, but O(n).UnmodSortedIterator<T>iterator()Returns items in a guaranteed order.-
Methods inherited from interface org.organicdesign.fp.xform.Transformable
toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableRrbt, toMutableSet, toMutableSortedMap, toMutableSortedSet
-
-
-
-
Method Detail
-
equal
static boolean equal(UnmodSortedIterable a, UnmodSortedIterable b)
This is correct, but O(n). This only works with an ordered iterable.
-
castFromSortedSet
static <E> UnmodSortedIterable<E> castFromSortedSet(java.util.SortedSet<E> s)
-
castFromList
static <E> UnmodSortedIterable<E> castFromList(java.util.List<E> s)
-
castFromSortedMap
static <K,V> UnmodSortedIterable<UnmodMap.UnEntry<K,V>> castFromSortedMap(java.util.SortedMap<K,V> sm)
-
iterator
UnmodSortedIterator<T> iterator()
Returns items in a guaranteed order.- Specified by:
iteratorin interfacejava.lang.Iterable<T>- Specified by:
iteratorin interfaceUnmodIterable<T>
-
-