com.hp.hpl.jena.util.iterator
Class SingletonIterator

java.lang.Object
  extended bycom.hp.hpl.jena.util.iterator.NiceIterator
      extended bycom.hp.hpl.jena.util.iterator.SingletonIterator
All Implemented Interfaces:
ClosableIterator, ExtendedIterator, java.util.Iterator

public class SingletonIterator
extends NiceIterator
implements ExtendedIterator

A ClosableIterator that contains only one element

Version:
$Revision: 1.4 $ on $Date: 2003/06/20 14:28:40 $
Author:
Dave Reynolds

Constructor Summary
SingletonIterator(java.lang.Object element)
          Constructor
 
Method Summary
 boolean hasNext()
          Can return a single value
 java.lang.Object next()
          Return the value
 
Methods inherited from class com.hp.hpl.jena.util.iterator.NiceIterator
andThen, andThen, close, filterDrop, filterKeep, mapWith, remove
 
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
 
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(java.lang.Object 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
Overrides:
hasNext in class NiceIterator

next

public java.lang.Object next()
Return the value

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


Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.