- All Superinterfaces:
Iterable<T>,RandomAccess
- All Known Subinterfaces:
BoundedChromosome<A,,G> Chromosome<G>,ISeq<T>,MSeq<T>,NumericChromosome<N,,G> Seq<T>,TreeChromosome<A,G>
- All Known Implementing Classes:
AbstractChromosome,AbstractTreeChromosome,AnyChromosome,io.jenetics.internal.collection.ArrayISeq,io.jenetics.internal.collection.ArraySeq,BigIntegerChromosome,BitChromosome,CharacterChromosome,CharSeq,DoubleChromosome,Genotype,IntegerChromosome,LongChromosome,PermutationChromosome,ProgramChromosome
General base interface for an ordered, fixed sized, object sequence.
- Since:
- 5.2
- Version:
- 5.2
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidget(int index) Return the value at the givenindex.default booleanisEmpty()Returnstrueif this sequence contains no elements.iterator()intlength()Return the length of this sequence.default ListIterator<T> Returns a list iterator over the elements in this sequence (in proper order).default booleannonEmpty()Returnstrueif 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
Returnstrueif this sequence contains no elements.- Returns:
trueif this sequence contains no elements- Since:
- 6.0
-
nonEmpty
Returnstrueif this sequence contains at least one element.- Returns:
trueif 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:
spliteratorin interfaceIterable<T>
-