com.hp.hpl.jena.util.iterator
Class SingletonIterator<T>

java.lang.Object
  extended by com.hp.hpl.jena.util.iterator.NiceIterator<T>
      extended by com.hp.hpl.jena.util.iterator.SingletonIterator<T>
All Implemented Interfaces:
ClosableIterator<T>, ExtendedIterator<T>, java.util.Iterator<T>

public class SingletonIterator<T>
extends NiceIterator<T>
implements ExtendedIterator<T>

A ClosableIterator that contains only one element

Version:
$Revision: 1.1 $ on $Date: 2009/06/29 08:55:49 $
Author:
Dave Reynolds

Constructor Summary
SingletonIterator(T element)
          Constructor
 
Method Summary
 boolean hasNext()
          Can return a single value
 T next()
          Return the value
 
Methods inherited from class com.hp.hpl.jena.util.iterator.NiceIterator
andThen, andThen, asList, asSet, close, close, emptyIterator, filterDrop, filterKeep, mapWith, remove, removeNext, toList, toSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.util.iterator.ExtendedIterator
andThen, filterDrop, filterKeep, mapWith, removeNext, toList, toSet
 
Methods inherited from interface com.hp.hpl.jena.util.iterator.ClosableIterator
close
 
Methods inherited from interface java.util.Iterator
remove
 

Constructor Detail

SingletonIterator

public SingletonIterator(T element)
Constructor

Parameters:
element - the single value to be returned
Method Detail

hasNext

public boolean hasNext()
Can return a single value

Specified by:
hasNext in interface java.util.Iterator<T>
Overrides:
hasNext in class NiceIterator<T>

next

public T next()
Return the value

Specified by:
next in interface java.util.Iterator<T>
Overrides:
next in class NiceIterator<T>


Copyright ? 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP