Package org.cactoos.iterable
Class Sorted<T>
- java.lang.Object
-
- org.cactoos.iterable.IterableEnvelope<T>
-
- org.cactoos.iterable.Sorted<T>
-
- Type Parameters:
T
- Element type
- All Implemented Interfaces:
Iterable<T>
public final class Sorted<T> extends IterableEnvelope<T>
Sorted iterable.There is no thread-safety guarantee.
- Since:
- 0.7
-
-
Method Summary
-
Methods inherited from class org.cactoos.iterable.IterableEnvelope
equals, hashCode, iterator, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
Sorted
@SafeVarargs public Sorted(T... src)
Ctor.- Parameters:
src
- The underlying iterable
-
Sorted
public Sorted(Iterable<? extends T> src)
Ctor.If you're using this ctor you must be sure that type
T
implementsComparable
interface. Otherwise, there will be a type casting exception in runtime.- Parameters:
src
- The underlying iterable
-
Sorted
@SafeVarargs public Sorted(Comparator<? super T> cmp, T... src)
Ctor.- Parameters:
cmp
- The comparatorsrc
- The underlying iterable
-
Sorted
public Sorted(Comparator<? super T> cmp, Iterable<? extends T> src)
Ctor.- Parameters:
cmp
- The comparatorsrc
- The underlying iterable
-
-