Package org.cactoos.iterable
Class Synced<X>
- java.lang.Object
-
- org.cactoos.iterable.Synced<X>
-
- Type Parameters:
X
- Type of item
- All Implemented Interfaces:
Iterable<X>
public final class Synced<X> extends Object implements Iterable<X>
Synchronized iterable.This class should be used very carefully. You must understand that it will fetch the entire content of the encapsulated
Iterable
on each method call. It doesn't cache the data anyhow. If you don't need thisIterable
to re-fresh its content on every call, by doing round-trips to the encapsulated iterable, useSticky
.Objects of this class are thread-safe.
- Since:
- 0.24
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<X>
iterator()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
Synced
@SafeVarargs public Synced(X... src)
Ctor.- Parameters:
src
- The underlying iterable
-
Synced
public Synced(Iterable<? extends X> iterable)
Ctor.- Parameters:
iterable
- The iterable synchronize access to.
-
-