Class IntRange
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<Integer>
-
- net.automatalib.common.util.collection.IntRange
-
- All Implemented Interfaces:
Iterable<Integer>
,Collection<Integer>
,List<Integer>
,RandomAccess
,ArrayWritable<Integer>
public final class IntRange extends AbstractList<Integer> implements ArrayWritable<Integer>, RandomAccess
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(@Nullable Object o)
Integer
get(int index)
int
indexOf(int i)
int
indexOf(@Nullable Object o)
int
intGet(int index)
IntRangeIterator
iterator()
int
lastIndexOf(@Nullable Object o)
IntRangeIterator
listIterator()
IntRangeIterator
listIterator(int index)
int
size()
The size of this container.void
writeToArray(int offset, @Nullable Object[] array, int tgtOfs, int num)
Writes the contents of this container to an array.-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
get
public Integer get(int index)
-
intGet
public int intGet(int index)
-
contains
public boolean contains(@Nullable Object o)
- Specified by:
contains
in interfaceCollection<Integer>
- Specified by:
contains
in interfaceList<Integer>
- Overrides:
contains
in classAbstractCollection<Integer>
-
indexOf
public int indexOf(int i)
-
lastIndexOf
public int lastIndexOf(@Nullable Object o)
- Specified by:
lastIndexOf
in interfaceList<Integer>
- Overrides:
lastIndexOf
in classAbstractList<Integer>
-
iterator
public IntRangeIterator iterator()
-
listIterator
public IntRangeIterator listIterator()
- Specified by:
listIterator
in interfaceList<Integer>
- Overrides:
listIterator
in classAbstractList<Integer>
-
listIterator
public IntRangeIterator listIterator(int index)
- Specified by:
listIterator
in interfaceList<Integer>
- Overrides:
listIterator
in classAbstractList<Integer>
-
size
public int size()
Description copied from interface:ArrayWritable
The size of this container.- Specified by:
size
in interfaceArrayWritable<Integer>
- Specified by:
size
in interfaceCollection<Integer>
- Specified by:
size
in interfaceList<Integer>
- Specified by:
size
in classAbstractCollection<Integer>
-
writeToArray
public void writeToArray(int offset, @Nullable Object[] array, int tgtOfs, int num)
Description copied from interface:ArrayWritable
Writes the contents of this container to an array. The behavior of calling this method should be equivalent toSystem.arraycopy(this.toArray(), offset, array, tgtOfs, num);
- Specified by:
writeToArray
in interfaceArrayWritable<Integer>
- Parameters:
offset
- how many elements of this container to skip.array
- the array in which to store the elements.tgtOfs
- the starting offset in the target array.num
- the maximum number of elements to copy.
-
-