Package com.complexible.common.rdf.rio

# Class DelegatingRDFStream

java.lang.Object
com.complexible.common.rdf.rio.DelegatingRDFStream

All Implemented Interfaces:
  `RDFStream`, `Closeable`, `AutoCloseable`

public class DelegatingRDFStream extends Object implements RDFStream

Since:
  7.1
Author:
  Pavel Klinov

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DelegatingRDFStream(RDFStream theStream)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `bytesRead()`
  Supposed to return the number currently parsed.
  `void`
  `close()`
  `long`
  `estimatedCount()`
  Estimated size of statements.
  `Resource`
  `getContext()`
  Returns the default context associated with this stream or `null` if there is no default context.
  `String`
  `getName()`
  Returns the name of this stream.
  `boolean`
  `hasContext()`
  Returns `true` either if this stream has a non-null `context` or the statements generated by this stream has contexts.
  `long`
  `length()`
  `void`
  `parse(RDFHandler theHandler)`
  Parses the stream and passes the statements to the given handler.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DelegatingRDFStream

    public DelegatingRDFStream(RDFStream theStream)

- ## Method Details

  - ### parse

    public void parse(RDFHandler theHandler) throws IOException, InvalidRDF, RDFHandlerException
    Description copied from interface: `RDFStream`
    Parses the stream and passes the statements to the given handler.
    Specified by:
      `parse` in interface `RDFStream`
    Throws:
      `IOException`
      `InvalidRDF`
      `RDFHandlerException`

  - ### getContext

    public Resource getContext()
    Description copied from interface: `RDFStream`
    Returns the default context associated with this stream or `null` if there is no default context. Note that, the statements that will be sent to the handler may not be using this context and the user of this stream should make sure the context information is used correctly.
    Specified by:
      `getContext` in interface `RDFStream`

  - ### hasContext

    public boolean hasContext()
    Description copied from interface: `RDFStream`
    Returns `true` either if this stream has a non-null `context` or the statements generated by this stream has contexts.
    Specified by:
      `hasContext` in interface `RDFStream`

  - ### getName

    public String getName()
    Description copied from interface: `RDFStream`
    Returns the name of this stream. If the stream is backed by a file this will return the file's name. Otherwise it might be an auto-generated name or some other (not necessarily unique) name.
    Specified by:
      `getName` in interface `RDFStream`

  - ### bytesRead

    public long bytesRead()
    Description copied from interface: `RDFStream`
    Supposed to return the number currently parsed. Can be used for progress reporting from RDFHandler
    Specified by:
      `bytesRead` in interface `RDFStream`
    Returns:
      Number of bytes parsed

  - ### length

    public long length()
    Specified by:
      `length` in interface `RDFStream`
    Returns:
      Length in bytes of underlying data

  - ### estimatedCount

    public long estimatedCount()
    Description copied from interface: `RDFStream`
    Estimated size of statements. Might be accurate or calculate only from the data size. Given N bytes in an RDFStream, the estimated number of statements depends on the RDF format. RDF stream may or may not be compressed, which also impacts the bytes-to-statements ratio.
    Specified by:
      `estimatedCount` in interface `RDFStream`
    Returns:
      estimated size of statements.

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `IOException`