Class UnionIterable

java.lang.Object
com.invirgance.convirgance.transform.sets.UnionIterable
All Implemented Interfaces:
Iterable<JSONObject>

public class UnionIterable extends Object implements Iterable<JSONObject>
Combines multiple streams of data into a single stream. Can be used to merge disparate sources such as files and database queries into a single resulting stream.

Does not attempt to de-duplicate data.
Author:
jbanes
  • Constructor Details

    • UnionIterable

      public UnionIterable(Iterable<JSONObject>... streams)
      Creates a UnionIterable to merge the provided streams
      Parameters:
      streams - the streams to merge into one
  • Method Details

    • iterator

      public Iterator<JSONObject> iterator()
      Returns an iterator that streams through each source sequentially
      Specified by:
      iterator in interface Iterable<JSONObject>
      Returns:
      An iterator that contains the supplied streams