org.openanzo.jastor
Class DatasetPropertyIterator<E>

java.lang.Object
  extended by org.openanzo.jastor.DatasetPropertyIterator<E>
Type Parameters:
E - The Jastor Type for the values that this iterator of properties represents
All Implemented Interfaces:
info.aduna.collections.iterators.CloseableIterator<E>, java.io.Closeable, java.util.Iterator<E>

public abstract class DatasetPropertyIterator<E>
extends java.lang.Object
implements info.aduna.collections.iterators.CloseableIterator<E>

Iterator that iterates over the set of object values for a given property on a given subject. Based on doing a find within the dataset for the given subject and property within a set of contexts

Author:
Ben Szekely (bhszekel@us.ibm.com)

Constructor Summary
DatasetPropertyIterator(IDataset dataset, org.openrdf.model.Resource resource, org.openrdf.model.URI property, org.openrdf.model.Resource... context)
          Create iterator of object values for a given property on a given subject.
 
Method Summary
 void close()
          Close the underlying iterator
abstract  E getPropertyValue(org.openrdf.model.Value resource)
          Implementation must convert object Value to corresponding datatype
 boolean hasNext()
           
 E next()
          Get the next value from the iterator
 void remove()
          Remove current value value from the underlying iterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasetPropertyIterator

public DatasetPropertyIterator(IDataset dataset,
                               org.openrdf.model.Resource resource,
                               org.openrdf.model.URI property,
                               org.openrdf.model.Resource... context)
Create iterator of object values for a given property on a given subject.

Parameters:
dataset - Dataset that contains data to search
resource - Subject of statements to find
property - Property of statements to find
context - Contexts within dataset to search over
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<E>
Returns:
true if there is another value in the iterator

next

public E next()
Get the next value from the iterator

Specified by:
next in interface java.util.Iterator<E>
Returns:
next value from the iterator

remove

public void remove()
Remove current value value from the underlying iterator

Specified by:
remove in interface java.util.Iterator<E>

getPropertyValue

public abstract E getPropertyValue(org.openrdf.model.Value resource)
Implementation must convert object Value to corresponding datatype

Parameters:
resource - to convert to given datatype
Returns:
converted resource

close

public void close()
Close the underlying iterator

Specified by:
close in interface info.aduna.collections.iterators.CloseableIterator<E>
Specified by:
close in interface java.io.Closeable


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.