Package org.organicdesign.fp.collections
Interface UnmodSortedIterable<T>
-
- All Superinterfaces:
Iterable<T>
,Transformable<T>
,UnmodIterable<T>
- All Known Subinterfaces:
BaseList<E>
,ImList<E>
,ImSortedMap<K,V>
,ImSortedSet<E>
,MutList<E>
,UnmodList<E>
,UnmodSortedCollection<E>
,UnmodSortedMap<K,V>
,UnmodSortedSet<E>
- All Known Implementing Classes:
PersistentTreeMap
,PersistentTreeSet
,PersistentVector
,PersistentVector.MutVector
,RangeOfInt
,RrbTree
,RrbTree.ImRrbt
,RrbTree.MutRrbt
,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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodIterable
UnmodIterable.UnIterable
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <E> UnmodSortedIterable<E>
castFromList(List<E> s)
static <K,V>
UnmodSortedIterable<UnmodMap.UnEntry<K,V>>castFromSortedMap(SortedMap<K,V> sm)
static <E> UnmodSortedIterable<E>
castFromSortedSet(SortedSet<E> s)
static boolean
equal(UnmodSortedIterable a, UnmodSortedIterable b)
This is correct, but O(n).@NotNull UnmodSortedIterator<T>
iterator()
Returns items in a guaranteed order.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.organicdesign.fp.xform.Transformable
any, toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutList, toMutMap, toMutRrbt, toMutSet, toMutSortedMap, toMutSortedSet
-
-
-
-
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(SortedSet<E> s)
-
castFromList
static <E> UnmodSortedIterable<E> castFromList(List<E> s)
-
castFromSortedMap
static <K,V> UnmodSortedIterable<UnmodMap.UnEntry<K,V>> castFromSortedMap(SortedMap<K,V> sm)
-
iterator
@NotNull @NotNull UnmodSortedIterator<T> iterator()
Returns items in a guaranteed order.
-
-