Package org.apache.jena.util.iterator
Class SingletonIterator<T>
- java.lang.Object
-
- org.apache.jena.util.iterator.NiceIterator<T>
-
- org.apache.jena.util.iterator.SingletonIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
,ClosableIterator<T>
,ExtendedIterator<T>
public class SingletonIterator<T> extends NiceIterator<T> implements ExtendedIterator<T>
A ClosableIterator that contains only one element
-
-
Constructor Summary
Constructors Constructor Description SingletonIterator(T element)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Can return a single valueT
next()
Return the value-
Methods inherited from class org.apache.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 org.apache.jena.util.iterator.ClosableIterator
close
-
Methods inherited from interface org.apache.jena.util.iterator.ExtendedIterator
andThen, filterDrop, filterKeep, forEach, mapWith, nextOptional, removeNext, toList, toSet
-
-
-
-
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 interfacejava.util.Iterator<T>
- Overrides:
hasNext
in classNiceIterator<T>
-
next
public T next()
Return the value- Specified by:
next
in interfacejava.util.Iterator<T>
- Overrides:
next
in classNiceIterator<T>
-
-