Class 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 this Iterable to re-fresh its content on every call, by doing round-trips to the encapsulated iterable, use Sticky.

    Objects of this class are thread-safe.

    Since:
    0.24
    • 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.
      • Synced

        public Synced​(Object lck,
                      Iterable<? extends X> iterable)
        Ctor.
        Parameters:
        lck - The lock to synchronize with.
        iterable - The iterable synchronize access to.