- All Superinterfaces:
Iterable<T>
,RandomAccess
- All Known Subinterfaces:
BaseMSeq<T>
,BoundedChromosome<A,
,G> Chromosome<G>
,ISeq<T>
,MSeq<T>
,NumericChromosome<N,
,G> Seq<T>
- All Known Implementing Classes:
AbstractChromosome
,AnyChromosome
,Array
,ArrayISeq
,ArrayMSeq
,ArraySeq
,BitChromosome
,CharacterChromosome
,CharSeq
,DoubleChromosome
,Empty.EmptyISeq
,Empty.EmptyMSeq
,Genotype
,IntegerChromosome
,LongChromosome
,PermutationChromosome
General base interface for an ordered, fixed sized, object sequence.
- Since:
- 5.2
- Version:
- 5.2
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
get
(int index) Return the value at the givenindex
.default boolean
isEmpty()
Returnstrue
if this sequence contains no elements.iterator()
int
length()
Return the length of this sequence.default ListIterator<T>
Returns a list iterator over the elements in this sequence (in proper order).default boolean
nonEmpty()
Returnstrue
if this sequence contains at least one element.default Spliterator<T>
stream()
Returns a sequential Stream with this sequence as its source.
-
Method Details
-
get
Return the value at the givenindex
.- Parameters:
index
- index of the element to return.- Returns:
- the value at the given
index
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()).
-
length
int length()Return the length of this sequence. Once the sequence is created, the length can't be changed.- Returns:
- the length of this sequence.
-
isEmpty
Returnstrue
if this sequence contains no elements.- Returns:
true
if this sequence contains no elements- Since:
- 6.0
-
nonEmpty
Returnstrue
if this sequence contains at least one element.- Returns:
true
if this sequence contains at least one element- Since:
- 6.0
-
forEach
-
iterator
-
listIterator
Returns a list iterator over the elements in this sequence (in proper order).- Returns:
- a list iterator over the elements in this sequence (in proper order)
-
stream
Returns a sequential Stream with this sequence as its source.- Returns:
- a sequential Stream over the elements in this sequence
-
spliterator
- Specified by:
spliterator
in interfaceIterable<T>
-