|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.data.streams.dsl.Streams
public class Streams
The definitions of an eDSL of stream and stream-related expressions.
| Field Summary | |
|---|---|
static FaultHandler |
IGNORE_POLICY
A IgnoreHandler for failure handling. |
static NoOpGenerator<String> |
no_serialiser
A NoOpGenerator. |
static FaultHandler |
RETHROW_POLICY
A RethrowHandler for failure handling. |
static FaultHandler |
RETHROW_UNRECOVERABLE_POLICY
A RethrowUnrecoverableHandler for failure handling. |
static FaultHandler |
STOPFAST_POLICY
A StopFastHandler for failure handling. |
| Constructor Summary | |
|---|---|
Streams()
|
|
| Method Summary | ||
|---|---|---|
static
|
consume(Stream<E> stream)
Starts a sentence to consume a Stream |
|
static
|
convert(E... elements)
Converts one or more elements into a Stream. |
|
static
|
convert(Iterable<E> iterable)
Converts an Iterable to a Stream. |
|
static
|
convert(Iterator<E> itarator)
Converts an Iterator to a Stream. |
|
static
|
convert(IteratorAdapter<E> adapter)
Converts a custom IteratorAdapter to a Stream. |
|
static RsOfClause<gr.uoa.di.madgik.grs.record.Record> |
convert(URI locator)
Starts a sentence to convert a resultset into a Stream. |
|
static
|
convertWithFaults(Class<E> clazz,
List<? extends Object> elements)
Converts a mixture of exceptions and elements of a given type to a Stream of a that type. |
|
static
|
convertWithFaults(Class<E> clazz,
Object... elements)
Converts a mixture of exceptions and elements of a given type to a Stream of a that type. |
|
static
|
fold(Stream<E> stream)
Starts a sentence to produce a Stream that groups of elements of another Stream. |
|
static
|
guard(Stream<E> stream)
Starts a sentence to produce a Stream that controls the error raised by another Stream. |
|
static
|
log(Stream<E> stream)
Returns a Stream that logs the throughput of an input Stream. |
|
static
|
monitor(Stream<E> stream)
Starts a sentence to produce a Stream that notifies key events in the iteration of another Stream. |
|
static
|
no_op(Stream<E> stream)
Returns a NoOpGenerator. |
|
static
|
pipe(Stream<E> stream)
Starts a sentence to produce a Stream generated from another Stream. |
|
static
|
publish(Stream<E> stream)
Starts a sentence to publish a Stream as a resultset. |
|
static PublishRsWithClause<String> |
publishStringsIn(Stream<String> stream)
Starts a sentence to publish a Stream as a resultset. |
|
static Stream<String> |
stringsIn(URI locator)
Returns a Stream of strings extracted from a resultset of RsStringRecordFactory.STRING_RECORDs. |
|
static
|
unfold(Stream<E> stream)
Starts a sentence to produce a Stream that unfolds the elements of another Stream. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static NoOpGenerator<String> no_serialiser
NoOpGenerator.
public static FaultHandler RETHROW_POLICY
RethrowHandler for failure handling.
public static FaultHandler RETHROW_UNRECOVERABLE_POLICY
RethrowUnrecoverableHandler for failure handling.
public static FaultHandler STOPFAST_POLICY
StopFastHandler for failure handling.
public static FaultHandler IGNORE_POLICY
IgnoreHandler for failure handling.
| Constructor Detail |
|---|
public Streams()
| Method Detail |
|---|
public static <E> ConsumeWithClause<E> consume(Stream<E> stream)
Stream
stream - the stream
public static <E> Stream<E> convert(Iterator<E> itarator)
Iterator to a Stream.
itarator - the iterator
public static <E> IteratorStream<E> convert(IteratorAdapter<E> adapter)
IteratorAdapter to a Stream.
adapter - the adapter
public static <E> Stream<E> convert(Iterable<E> iterable)
Iterable to a Stream.
iterable - the iterable
public static <E> Stream<E> convert(E... elements)
Stream.
elements - the elements
public static <E> Stream<E> convertWithFaults(Class<E> clazz,
Object... elements)
Stream of a that type.
It's the client's responsibility to ensure that the elements that are not exceptions are homogeneously typed as the type indicated in input.
clazz - the stream typeelements - the elements
public static <E> Stream<E> convertWithFaults(Class<E> clazz,
List<? extends Object> elements)
Stream of a that type.
It's the client's responsibility to ensure that the elements that are not exceptions are homogeneously typed as the type indicated in input.
clazz - the stream typeelements - the elements
public static RsOfClause<gr.uoa.di.madgik.grs.record.Record> convert(URI locator)
Stream.
locator - the locator of the resultset
public static Stream<String> stringsIn(URI locator)
Stream of strings extracted from a resultset of RsStringRecordFactory.STRING_RECORDs.
locator - the locator of the resultset
public static <E> PipeThroughClause<E> pipe(Stream<E> stream)
Stream generated from another Stream.
stream - the input stream.
public static <E> InClause<E> fold(Stream<E> stream)
Stream that groups of elements of another Stream.
stream - the input stream.
public static <E> UnfoldThroughClause<E> unfold(Stream<E> stream)
Stream that unfolds the elements of another Stream.
stream - the input stream.
public static <E> GuardWithClause<E> guard(Stream<E> stream)
Stream that controls the error raised by another Stream.
stream - the input stream.
public static <E> MonitorWithClause<E> monitor(Stream<E> stream)
Stream that notifies key events in the iteration of another Stream.
stream - the input stream.
public static <E> PublishRsUsingClause<E> publish(Stream<E> stream)
Stream as a resultset.
stream - the stream
public static PublishRsWithClause<String> publishStringsIn(Stream<String> stream)
Stream as a resultset.
stream - the stream
public static <E> Stream<E> log(Stream<E> stream)
Stream that logs the throughput of an input Stream.
stream - the input stream
public static <E> NoOpGenerator<E> no_op(Stream<E> stream)
NoOpGenerator.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||