Class Combinations.SingletonIterator
- java.lang.Object
-
- org.apache.commons.numbers.combinatorics.Combinations.SingletonIterator
-
- All Implemented Interfaces:
java.util.Iterator<int[]>
- Enclosing class:
- Combinations
private static class Combinations.SingletonIterator extends java.lang.Object implements java.util.Iterator<int[]>
Iterator with just one element to handle degenerate cases (full array, empty array) for combination iterator.
-
-
Constructor Summary
Constructors Constructor Description SingletonIterator(int n)
Create a singleton iterator providing the given array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
int[]
next()
void
remove()
Unsupported.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<int[]>
- Returns:
true
until next is called the first time, thenfalse
.
-
next
public int[] next()
- Specified by:
next
in interfacejava.util.Iterator<int[]>
- Returns:
- the singleton at the first activation.
- Throws:
java.util.NoSuchElementException
- after the first activation.
-
remove
public void remove()
Unsupported.- Specified by:
remove
in interfacejava.util.Iterator<int[]>
- Throws:
java.lang.UnsupportedOperationException
- Remove is not supported.
-
-