|
@@ -12,6 +12,7 @@ import java.util.Spliterator;
|
|
|
|
|
|
|
|
import net.ranides.assira.collection.iterators.IntListIterator;
|
|
import net.ranides.assira.collection.iterators.IntListIterator;
|
|
|
import net.ranides.assira.collection.iterators.RandomAccessSpliterator;
|
|
import net.ranides.assira.collection.iterators.RandomAccessSpliterator;
|
|
|
|
|
+import net.ranides.assira.collection.sets.IntSet;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Virtual list providing numbers from specified range.
|
|
* Virtual list providing numbers from specified range.
|
|
@@ -19,7 +20,7 @@ import net.ranides.assira.collection.iterators.RandomAccessSpliterator;
|
|
|
*
|
|
*
|
|
|
* @author Ranides Atterwim {@literal <ranides@gmail.com>}
|
|
* @author Ranides Atterwim {@literal <ranides@gmail.com>}
|
|
|
*/
|
|
*/
|
|
|
-public class IntRange extends AIntList implements RandomAccess {
|
|
|
|
|
|
|
+public class IntRange extends AIntList implements IntSet, RandomAccess {
|
|
|
|
|
|
|
|
private static final String E_IMMUTABLE = "Immutable.";
|
|
private static final String E_IMMUTABLE = "Immutable.";
|
|
|
|
|
|
|
@@ -89,6 +90,14 @@ public class IntRange extends AIntList implements RandomAccess {
|
|
|
throw new UnsupportedOperationException(E_IMMUTABLE);
|
|
throw new UnsupportedOperationException(E_IMMUTABLE);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public int begin() {
|
|
|
|
|
+ return begin;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public int end() {
|
|
|
|
|
+ return end;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private class IntRangeIterator implements IntListIterator {
|
|
private class IntRangeIterator implements IntListIterator {
|
|
|
|
|
|
|
|
private int current;
|
|
private int current;
|