Class LibRDF_StreamIterator

Description

Implements interfaces:

  • Iterator (internal interface)

Wrap a librdf_stream resource as an iterable object.

This class should not be created directly, nor are its methods of interest to the casual user. Its only intent is to provide a return type for LibRDF_Model::find_statements, as well as the underlying iterator for both LibRDF_Model and LibRDF_GraphQueryResults, that can then be used in a PHP foreach statement without any direct function calls.

Objects of this type may only be used for iteration once. Once iteration has begun, a call to rewind will render the object invalid.

Located in /Iterator.php (line 62)


	
			
Method Summary
void __construct (resource $stream, [mixed $source = NULL])
void __destruct ()
integer key ()
void next ()
void rewind ()
boolean valid ()
void __clone ()
Methods
Constructor __construct (line 124)

Create a new iterable object from a librdf_stream resource.

User functions should not create librdf_stream resources directly, so this constructor is intended only to provide an interface into the streams returned by librdf functions and called by LibRDF classes.

  • access: public
void __construct (resource $stream, [mixed $source = NULL])
  • resource $stream: The librdf_stream object to wrap
  • mixed $source: The object that created the stream
Destructor __destruct (line 139)

Free the stream's resources.

  • access: public
void __destruct ()
current (line 183)

Return the current statement or NULL if the stream is no longer valid.

  • return: The current statement on the iterator
  • access: public
LibRDF_Statement current ()

Implementation of:
Iterator::current
key (line 205)

Return the key of the current element on the stream.

  • return: The current key
  • access: public
integer key ()

Implementation of:
Iterator::key
next (line 216)

Advance the stream's position.

  • access: public
void next ()

Implementation of:
Iterator::next
rewind (line 170)

Rewind the stream.

Rewinding is not supported, so this call invalidates the stream unless the stream is still at the starting position.

  • access: public
void rewind ()

Implementation of:
Iterator::rewind
valid (line 235)

Return whether the stream is still valid.

  • return: Whether the stream is still valid
  • access: public
boolean valid ()

Implementation of:
Iterator::valid
__clone (line 155)

Clone a LibRDF_StreamIterator object.

Cloning a stream is unsupported, so using the clone operator on a LibRDF_StreamIterator object will produce an empty iterator.

  • access: public
void __clone ()

Documentation generated on Thu, 15 Jun 2006 19:25:12 -0400 by phpDocumentor 1.3.0