- All Implemented Interfaces:
BaseSeq<T>,Copyable<MSeq<T>>,MSeq<T>,Seq<T>,Serializable,Iterable<T>,IntFunction<T>,RandomAccess
- Since:
- 1.4
- Version:
- 3.4
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn a newSeqwith the givenvaluesappended.protected voidcheckIndex(int start, int end, int otherStart, int otherLength) copy()Return a new copy of typeT.Fill the sequence with values generated by the given factory.iterator()Returns a list iterator over the elements in this sequence (in a proper sequence).<B> MSeq<B>Builds a new sequence by applying a function to all elements of this sequence.Return a newSeqwith the givenvaluesprepended.voidSet thevalueat the givenindex.Fills the sequence with values of the given iterable.Fills the sequence with values of the given iterator.Fill the sequence with the given values.shuffle(RandomGenerator random) Randomize thearrayusing the givenRandomGeneratorobject.sort(int start, int end, Comparator<? super T> comparator) Sorts this sequence according to the order induced by the specifiedComparator.subSeq(int start) Returns a view of the portion of this sequence between the specifiedstart, inclusive, andend, exclusive.subSeq(int start, int end) Returns a view of the portion of this sequence between the specifiedstart, inclusive, andend, exclusive.voidswap(int i, int j) Swap the elements at the two positions.voidSwap a given range with a range of the same size with another array.toISeq()Return a read-only projection of this sequence.Methods inherited from class io.jenetics.internal.collection.ArraySeq
equals, forAll, forEach, get, hashCode, indexWhere, lastIndexWhere, length, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.jenetics.util.BaseSeq
forEach, get, isEmpty, length, nonEmpty, spliterator, streamMethods inherited from interface io.jenetics.util.MSeq
append, asList, prepend, reverse, shuffle, sort, sort, sort, sort, sort, swapMethods inherited from interface io.jenetics.util.Seq
apply, asISeq, asMSeq, contains, equals, forAll, hashCode, indexOf, indexOf, indexOf, indexWhere, indexWhere, indexWhere, isSorted, isSorted, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, lastIndexWhere, parallelStream, size, toArray, toArray, toArray, toString, toString
-
Constructor Details
-
ArrayMSeq
-
-
Method Details
-
copy
Description copied from interface:CopyableReturn a new copy of typeT. -
iterator
-
listIterator
Description copied from interface:MSeqReturns a list iterator over the elements in this sequence (in a proper sequence).- Specified by:
listIteratorin interfaceBaseSeq<T>- Specified by:
listIteratorin interfaceMSeq<T>- Returns:
- a list iterator over the elements in this list (in a proper sequence)
-
set
Description copied from interface:MSeqSet thevalueat the givenindex. -
setAll
Description copied from interface:MSeqFills the sequence with values of the given iterator. -
setAll
Description copied from interface:MSeqFills the sequence with values of the given iterable. -
setAll
Description copied from interface:MSeqFill the sequence with the given values. -
fill
Description copied from interface:MSeqFill the sequence with values generated by the given factory. -
sort
Description copied from interface:MSeqSorts this sequence according to the order induced by the specifiedComparator.All elements in this sequence must be mutually comparable using the specified comparator (that is,
c.compare(e1, e2)must not throw aClassCastExceptionfor any elementse1ande2in the sequence).If the specified comparator is
nullthen all elements in this list must implement theComparableinterface and the elements' Comparable natural ordering should be used.- Specified by:
sortin interfaceMSeq<T>- Parameters:
start- the start index where to start sorting (inclusively)end- the end index where to stop sorting (exclusively)comparator- theComparatorused to compare sequence elements. Anullvalue indicates that the elements' Comparable natural ordering should be used- Returns:
thissequence
-
shuffle
Description copied from interface:MSeqRandomize thearrayusing the givenRandomGeneratorobject. The used shuffling algorithm is from D. Knuth TAOCP, Seminumerical Algorithms, Third edition, page 142, Algorithm S (Selection sampling technique).- Specified by:
shufflein interfaceMSeq<T>- Parameters:
random- theRandomGeneratorobject to use for randomize.- Returns:
- this shuffled sequence
-
swap
Description copied from interface:MSeqSwap the elements at the two positions. -
swap
Description copied from interface:MSeqSwap a given range with a range of the same size with another array.start end | | this: +---+---+---+---+---+---+---+---+---+---+---+---+ +---------------+ +---------------+ other: +---+---+---+---+---+---+---+---+---+---+---+---+ | otherStart -
checkIndex
-
subSeq
Description copied from interface:SeqReturns a view of the portion of this sequence between the specifiedstart, inclusive, andend, exclusive. (Ifstartandendare equal, the returned sequence has length zero.) The returned sequence is backed by this sequence, so non-structural changes in the returned sequence are reflected in this array, and vice-versa.This method eliminates the need for explicit range operations (of the populationSort that commonly exist for arrays). Any operation that expects an array can be used as a range operation by passing a subsequence view instead of a whole sequence.
-
subSeq
Description copied from interface:SeqReturns a view of the portion of this sequence between the specifiedstart, inclusive, andend, exclusive. (Ifstartandendare equal, the returned sequence has length zero.) The returned sequence is backed by this sequence, so non-structural changes in the returned sequence are reflected in this sequence, and vice-versa.This method eliminates the need for explicit range operations (of the populationSort that commonly exist for arrays). Any operation that expects a sequence can be used as a range operation by passing a sub-sequence view instead of a whole sequence.
-
map
Description copied from interface:SeqBuilds a new sequence by applying a function to all elements of this sequence.- Specified by:
mapin interfaceMSeq<T>- Specified by:
mapin interfaceSeq<T>- Type Parameters:
B- the element type of the returned collection.- Parameters:
mapper- the function to apply to each element.- Returns:
- a new sequence of type That resulting from applying the given function f to each element of this sequence and collecting the results.
-
append
Description copied from interface:SeqReturn a newSeqwith the givenvaluesappended. -
prepend
Description copied from interface:SeqReturn a newSeqwith the givenvaluesprepended. -
toISeq
Description copied from interface:MSeqReturn a read-only projection of this sequence. Changes to the original sequence will not influence the returnedISeq.
-