it.uniroma2.art.owlart.models.impl
Class ResourceIteratorWrappingNodeIterator

java.lang.Object
  extended by it.uniroma2.art.owlart.models.impl.ResourceIteratorWrappingNodeIterator
All Implemented Interfaces:
ARTResourceIterator, RDFIterator<ARTResource>, java.util.Iterator<ARTResource>

public class ResourceIteratorWrappingNodeIterator
extends java.lang.Object
implements ARTResourceIterator

An adapter class between Node and Resource Iterators. This is to be used if the developer knows in advance that wrapped iterator contains only Literals. It is more performant than the ResourceIteratorWrappingNodeIterator because it omits checks on the nature of the wrapped nodes, expecting them to be Resources

Author:
Armando Stellato

Constructor Summary
ResourceIteratorWrappingNodeIterator(ARTNodeIterator resIt)
           
 
Method Summary
 void close()
          closes the iterator and release resources
 ARTResource getNext()
          gets the next element of the iterator, and advances over the data stream (roughly equivalent to traditional next() iterator method)
 boolean hasNext()
           
 ARTResource next()
           
 void remove()
           
 boolean streamOpen()
          tells if the data stream associated to this iterator is not empty (roughly equivalent to traditional hasNext() iterator method)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceIteratorWrappingNodeIterator

public ResourceIteratorWrappingNodeIterator(ARTNodeIterator resIt)
Method Detail

close

public void close()
           throws ModelAccessException
Description copied from interface: RDFIterator
closes the iterator and release resources

Specified by:
close in interface RDFIterator<ARTResource>
Throws:
ModelAccessException

streamOpen

public boolean streamOpen()
                   throws ModelAccessException
Description copied from interface: RDFIterator
tells if the data stream associated to this iterator is not empty (roughly equivalent to traditional hasNext() iterator method)

Specified by:
streamOpen in interface RDFIterator<ARTResource>
Returns:
Throws:
ModelAccessException

getNext

public ARTResource getNext()
                    throws ModelAccessException
Description copied from interface: RDFIterator
gets the next element of the iterator, and advances over the data stream (roughly equivalent to traditional next() iterator method)

Specified by:
getNext in interface RDFIterator<ARTResource>
Returns:
Throws:
ModelAccessException

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<ARTResource>

next

public ARTResource next()
Specified by:
next in interface java.util.Iterator<ARTResource>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<ARTResource>


Copyright © 2011 ART Group, University of Rome, Tor Vergata. All Rights Reserved.