org.openrdf.sesame.sailimpl.memory
Class MemLiteralIterator

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.memory.MemLiteralIterator
All Implemented Interfaces:
LiteralIterator, ValueIterator

public class MemLiteralIterator
extends Object
implements LiteralIterator

An implementation of org.openrdf.sesame.sail.LiteralIterator that can iterate over a list of Literal objects.

Version:
$Revision: 1.4.4.2 $
Author:
Arjohn Kampman

Constructor Summary
MemLiteralIterator(Collection literals)
          Creates a new LiteralIterator that iterates over all objects in the supplied list.
MemLiteralIterator(Collection literals, String label, String language, URI datatype)
          Creates a new LiteralIterator that iterates over all objects in the supplied list, only returning the ones that have the specified label, language and/or datatype.
 
Method Summary
 void close()
          Closes the iterator and frees any resources that it uses (e.g.
 boolean hasNext()
          Checks whether there are any more values available.
 Value next()
          Gets the next value.
 Literal nextLiteral()
          Gets the next Literal.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemLiteralIterator

public MemLiteralIterator(Collection literals)
Creates a new LiteralIterator that iterates over all objects in the supplied list.

Parameters:
literals - A Collection containing Literal objects

MemLiteralIterator

public MemLiteralIterator(Collection literals,
                          String label,
                          String language,
                          URI datatype)
Creates a new LiteralIterator that iterates over all objects in the supplied list, only returning the ones that have the specified label, language and/or datatype.

Parameters:
literals - A Collection containing Literal objects
label - The label that the returned literals should have, or null if literals with any label should be returned.
language - The language that the returned literals should have, or null if literals with any language should be returned.
datatype - The datatype that the returned literals should have, or null if literals with any datatype should be returned.
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: ValueIterator
Checks whether there are any more values available.

Specified by:
hasNext in interface ValueIterator
Returns:
true if there are more values available, false otherwise.

next

public Value next()
Description copied from interface: ValueIterator
Gets the next value.

Specified by:
next in interface ValueIterator
Returns:
the next value.

nextLiteral

public Literal nextLiteral()
Description copied from interface: LiteralIterator
Gets the next Literal.

Specified by:
nextLiteral in interface LiteralIterator
Returns:
the next Literal
See Also:
ValueIterator.next()

close

public void close()
Description copied from interface: ValueIterator
Closes the iterator and frees any resources that it uses (e.g. connections to databases). Every ValueIterator should be properly closed when it has returned all of its values, or when it is no longer needed.

Specified by:
close in interface ValueIterator


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.