Streams
Date: 2013-06-18

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gcube.contentmanagement.gcubedocumentlibrary.streams.dsl
Class Streams

    java.lang.Object
      org.gcube.contentmanagement.gcubedocumentlibrary.streams.dsl.Streams

    public class Streams

extends java.lang.Object

An embedded language for manipulation of streams based on `Iterator`s, `RemoteIterator`s, and result sets.

Author:
  Fabio Simeoni (University of Strathclyde)

Field Summary
`static boolean` | `CONTINUE` An alias for `true` to improve legibility of fault handling policies.
`static IFaultPolicy<java.lang.RuntimeException>` | `FAILFAST_POLICY` The `IFaultPolicy` that fails at iteration errors.
`static IFaultPolicy<java.lang.RuntimeException>` | `IGNORE_POLICY` The `IFaultPolicy` that ignores iteration errors.
`static` | `PASSTHROUGH_PARSER`
`static IFaultPolicy<java.lang.Exception>` | `RETHROW_POLICY` The `IFaultPolicy` that propagates iteration errors.
`static boolean` | `STOP` An alias for `false` to improve legibility of fault handling policies.
`static` | `URI_PARSER`

Constructor Summary
`Streams()`

Method Summary
`static` | `alternativesIn( docs)` Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubeAlternative`s.
`static java.util.Iterator<GCubeAlternative>` | `alternativesIn(java.util.Iterator<GCubeDocument> docs)` Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubeAlternative`s.
`static` | `alternativesIn(java.net.URI locator)` Converts a result set of into a `RemoteIterator` over `GCubeAlternative`.
`static` | `annotationsIn( docs)` Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubeAnnotation`s.
`static java.util.Iterator<GCubeAnnotation>` | `annotationsIn(java.util.Iterator<GCubeDocument> docs)` Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubeAnnotation`s.
`static` | `annotationsIn(java.net.URI locator)` Converts a result set of into a `RemoteIterator` over `GCubeAnnotation`.
`static
`<T> WithLocalClause<T,T>`
` | `convert( rit)` Converts a `RemoteIterator` into an `Iterator` using the `IGNORE_POLICY` for faults.
`static
`<T>`
` | `convert(java.util.Iterator<T> it)` Converts an `Iterator` in a `RemoteIterator`.
`static` | `documentsIn( it)` Converts a `RemoteIterator` over strings into a `RemoteIterator` over `GCubeDocument`s.
`static` | `documentsIn(java.net.URI locator)` Converts a result set of into a `RemoteIterator` over `GCubeDocument`s.
`static
`<FROM> InClause<FROM>`
` | `group( rit)` `group` clause for an `RemoteIterator`.
`static
`<FROM> InClause<FROM>`
` | `group(java.util.Iterator<FROM> it)` `group` clause for an `Iterator`.
`static` | `metadataIn( docs)` Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubeMetadata`s.
`static java.util.Iterator<GCubeMetadata>` | `metadataIn(java.util.Iterator<GCubeDocument> docs)` Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubeMetadata`s.
`static` | `metadataIn(java.net.URI locator)` Converts a result set of into a `RemoteIterator` over `GCubeMetadata`.
`static` | `partsIn( docs)` Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubePart`s.
`static java.util.Iterator<GCubePart>` | `partsIn(java.util.Iterator<GCubeDocument> docs)` Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubePart`s.
`static` | `partsIn(java.net.URI locator)` Converts a result set of into a `RemoteIterator` over `GCubePart`.
`static` | `payloadsIn(java.net.URI locator)` Converts a result set into a `RemoteIterator`.
`static
`<FROM> ThroughClause<FROM>`
` | `pipe( rit)` `pipe` clause for an `RemoteIterator`.
`static
`<FROM> ThroughClause<FROM>`
` | `pipe(java.util.Iterator<FROM> it)` `pipe` clause for an `Iterator`.
`static
`<FROM> UnfoldThroughClause<FROM>`
` | `unfold( rit)` `unfold` clause for an `RemoteIterator`.
`static
`<FROM> UnfoldThroughClause<FROM>`
` | `unfold(java.util.Iterator<FROM> it)` `unfold` clause for an `Iterator`.
`static` | `urisIn(java.net.URI locator, int timeout)` Converts a result set into a `RemoteIterator` of `URI`s.
`static
`<E extends GCubeElement> WithClause<E,java.net.URI>`
` | `urisOf( iterator)` Converts an `RemoteIterator` of `GCubeElement`s into a `WithClause` with which clients can generate `Iterator`s or `RemoteIterator`s over the elements' `URI`s.
`static
`<E extends GCubeElement> WithClause<E,java.net.URI>`
` | `urisOf(java.util.Iterator<E> iterator)` Converts an `Iterator` of `GCubeElement`s into a `WithClause` with which clients can generate `Iterator`s or `RemoteIterator`s over the elements' `URI`s.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### IGNORE_POLICY

    public static final IFaultPolicy<java.lang.RuntimeException> IGNORE_POLICY

  The `IFaultPolicy` that ignores iteration errors.

### FAILFAST_POLICY

    public static final IFaultPolicy<java.lang.RuntimeException> FAILFAST_POLICY

  The `IFaultPolicy` that fails at iteration errors.

### RETHROW_POLICY

    public static final IFaultPolicy<java.lang.Exception> RETHROW_POLICY

  The `IFaultPolicy` that propagates iteration errors.

### CONTINUE

    public static boolean CONTINUE

  An alias for `true` to improve legibility of fault handling policies.

### STOP

    public static boolean STOP

  An alias for `false` to improve legibility of fault handling policies.

### PASSTHROUGH_PARSER

    public static  PASSTHROUGH_PARSER

### URI_PARSER

    public static  URI_PARSER

Constructor Detail

### Streams

    public Streams()

Method Detail

### payloadsIn

    public static  payloadsIn(java.net.URI locator)
                            throws java.lang.Exception

  Converts a result set into a `RemoteIterator`.

  Parameters:
    `locator` - the result set locator.
  Returns:
    the iterator.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### urisIn

    public static  urisIn(java.net.URI locator,
                               int timeout)
                        throws java.lang.Exception

  Converts a result set into a `RemoteIterator` of `URI`s.

  Parameters:
    `locator` - the result set locator.
    `timeout` - the read timeout, in seconds.
  Returns:
    the iterator.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### urisOf

    public static <E extends GCubeElement> WithClause<E,java.net.URI> urisOf(java.util.Iterator<E> iterator)

  Converts an `Iterator` of `GCubeElement`s into a `WithClause` with which clients can generate `Iterator`s or `RemoteIterator`s over the elements' `URI`s.

  Parameters:
    `locator` - the element iterator.
  Returns:
    the `WithClause`.

### urisOf

    public static <E extends GCubeElement> WithClause<E,java.net.URI> urisOf( iterator)

  Converts an `RemoteIterator` of `GCubeElement`s into a `WithClause` with which clients can generate `Iterator`s or `RemoteIterator`s over the elements' `URI`s.

  Parameters:
    `locator` - the element iterator.
  Returns:
    the `WithClause`.

### documentsIn

    public static  documentsIn(java.net.URI locator)
                             throws java.lang.Exception

  Converts a result set of into a `RemoteIterator` over `GCubeDocument`s.

  Parameters:
    `locator` - the result set locator.
  Returns:
    the iterator.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### documentsIn

    public static  documentsIn( it)
                             throws java.lang.Exception

  Converts a `RemoteIterator` over strings into a `RemoteIterator` over `GCubeDocument`s.

  Parameters:
    `locator` - the iterator over strings.
  Returns:
    the iterator over `GCubeDocument`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### metadataIn

    public static  metadataIn(java.net.URI locator)
                            throws java.lang.Exception

  Converts a result set of into a `RemoteIterator` over `GCubeMetadata`.

  Parameters:
    `locator` - the result set locator.
  Returns:
    the iterator.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### metadataIn

    public static  metadataIn( docs)
                            throws java.lang.Exception

  Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubeMetadata`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubeMetadata`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### metadataIn

    public static java.util.Iterator<GCubeMetadata> metadataIn(java.util.Iterator<GCubeDocument> docs)
                                                        throws java.lang.Exception

  Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubeMetadata`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubeMetadata`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### annotationsIn

    public static  annotationsIn(java.net.URI locator)
                               throws java.lang.Exception

  Converts a result set of into a `RemoteIterator` over `GCubeAnnotation`.

  Parameters:
    `locator` - the result set locator.
  Returns:
    the iterator.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### annotationsIn

    public static  annotationsIn( docs)
                               throws java.lang.Exception

  Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubeAnnotation`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubeAnnotation`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### annotationsIn

    public static java.util.Iterator<GCubeAnnotation> annotationsIn(java.util.Iterator<GCubeDocument> docs)
                                                             throws java.lang.Exception

  Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubeAnnotation`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubeAnnotation`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### alternativesIn

    public static  alternativesIn(java.net.URI locator)
                                throws java.lang.Exception

  Converts a result set of into a `RemoteIterator` over `GCubeAlternative`.

  Parameters:
    `locator` - the result set locator.
  Returns:
    the iterator.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### alternativesIn

    public static  alternativesIn( docs)
                                throws java.lang.Exception

  Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubeAlternative`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubeAlternative`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### alternativesIn

    public static java.util.Iterator<GCubeAlternative> alternativesIn(java.util.Iterator<GCubeDocument> docs)
                                                               throws java.lang.Exception

  Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubeAlternative`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubeAlternative`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### partsIn

    public static  partsIn(java.net.URI locator)
                         throws java.lang.Exception

  Converts a result set of into a `RemoteIterator` over `GCubePart`.

  Parameters:
    `locator` - the result set locator.
  Returns:
    the iterator.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### partsIn

    public static  partsIn( docs)
                         throws java.lang.Exception

  Converts a `RemoteIterator` over `GCubeDocument`s into a `RemoteIterator` over `GCubePart`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubePart`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### partsIn

    public static java.util.Iterator<GCubePart> partsIn(java.util.Iterator<GCubeDocument> docs)
                                                 throws java.lang.Exception

  Converts a standard `Iterator` over `GCubeDocument`s into a standard `Iterator` over `GCubePart`s.

  Parameters:
    `locator` - the iterator over `GCubeDocument`s.
  Returns:
    the iterator over `GCubePart`s.
  Throws:
    `java.lang.Exception` - if the conversion failed.

### pipe

    public static <FROM> ThroughClause<FROM> pipe(java.util.Iterator<FROM> it)

  `pipe` clause for an `Iterator`.

  Type Parameters:
    `FROM` - the type of the objects iterated over.
  Parameters:
    `it` - the iterator.
  Returns:
    the next clause.

### pipe

    public static <FROM> ThroughClause<FROM> pipe( rit)

  `pipe` clause for an `RemoteIterator`.

  Type Parameters:
    `FROM` - the type of the objects iterated over.
  Parameters:
    `it` - the iterator.
  Returns:
    the next clause.

### group

    public static <FROM> InClause<FROM> group(java.util.Iterator<FROM> it)

  `group` clause for an `Iterator`.

  Type Parameters:
    `FROM` - the type of the objects iterated over.
  Parameters:
    `it` - the iterator.
  Returns:
    the next clause.

### group

    public static <FROM> InClause<FROM> group( rit)

  `group` clause for an `RemoteIterator`.

  Type Parameters:
    `FROM` - the type of the objects iterated over.
  Parameters:
    `it` - the iterator.
  Returns:
    the next clause.

### unfold

    public static <FROM> UnfoldThroughClause<FROM> unfold(java.util.Iterator<FROM> it)

  `unfold` clause for an `Iterator`.

  Type Parameters:
    `FROM` - the type of the objects iterated over.
  Parameters:
    `it` - the iterator.
  Returns:
    the next clause.

### unfold

    public static <FROM> UnfoldThroughClause<FROM> unfold( rit)

  `unfold` clause for an `RemoteIterator`.

  Type Parameters:
    `FROM` - the type of the objects iterated over.
  Parameters:
    `it` - the iterator.
  Returns:
    the next clause.

### convert

    public static <T> WithLocalClause<T,T> convert( rit)

  Converts a `RemoteIterator` into an `Iterator` using the `IGNORE_POLICY` for faults.

  Type Parameters:
    `T` - the type of the iterators.
  Parameters:
    `rit` - the `RemoteIterator`.
  Returns:
    the `Iterator`.

### convert

    public static <T>  convert(java.util.Iterator<T> it)

  Converts an `Iterator` in a `RemoteIterator`.

  Type Parameters:
    `T` - the type of the iterators.
  Parameters:
    `it` - the `Iterator`.
  Returns:
    the `RemoteIterator`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD