com.hp.hpl.jena.util
Class StatementObjectIterator

java.lang.Object
  |
  +--com.hp.hpl.jena.util.StatementObjectIterator
All Implemented Interfaces:
NodeIterator

public class StatementObjectIterator
extends java.lang.Object
implements NodeIterator

A wrapper for StmtIterator that projects the object of the statement to form a NodeIterator.

Version:
CVS info: $Id: StatementObjectIterator.java,v 1.1 2001/09/24 17:02:36 ijd Exp $
Author:
Ian Dickinson, HP Labs (email)

Constructor Summary
StatementObjectIterator(StmtIterator sIterator)
          Construct an iterator to project the object of the statement out to form a node iterator.
 
Method Summary
 void close()
          Terminate the iteration and free up resources.
 boolean hasNext()
          Determine if there any more Nodes in the iteration.
 RDFNode next()
          Return the next Node of the iteration.
 void remove()
          Unsupported Operation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatementObjectIterator

public StatementObjectIterator(StmtIterator sIterator)
Construct an iterator to project the object of the statement out to form a node iterator.
Parameters:
sIterator - The StmtIterator whose objects will form the elements of the the node iterator.
Method Detail

hasNext

public boolean hasNext()
                throws RDFException
Determine if there any more Nodes in the iteration.
Specified by:
hasNext in interface NodeIterator
Returns:
true if and only if there are more Resources available from the iteration.
Throws:
RDFException - Generic RDF exception.

next

public RDFNode next()
             throws java.util.NoSuchElementException,
                    RDFException
Return the next Node of the iteration.
Specified by:
next in interface NodeIterator
Returns:
The next Resource from the iteration.
Throws:
java.util.NoSuchElementException - if there are no more to be returned.
RDFException - Generic RDF exception.

remove

public void remove()
            throws java.util.NoSuchElementException,
                   RDFException
Unsupported Operation.
Specified by:
remove in interface NodeIterator
Throws:
java.util.NoSuchElementException -  
RDFException -  

close

public void close()
           throws RDFException
Terminate the iteration and free up resources.

Some implementations, e.g. on relational databases, hold resources while the iterator still exists. These will normally be freed when the iteration completes. However, if an application wishes to ensure they are freed without completing the iteration, this method should be called.

Specified by:
close in interface NodeIterator
Throws:
RDFException - Generic RDF exception.


Copyright 2001 Hewlett-Packard. All Rights Reserved.