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 booleanhasNext()int[]next()voidremove()Unsupported.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<int[]>- Returns:
trueuntil next is called the first time, thenfalse.
-
next
public int[] next()
- Specified by:
nextin 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:
removein interfacejava.util.Iterator<int[]>- Throws:
java.lang.UnsupportedOperationException- Remove is not supported.
-
-