java.lang.Object
ArraySeq<T>
- All Implemented Interfaces:
BaseSeq<T>,Seq<T>,Serializable,Iterable<T>,IntFunction<T>,RandomAccess
- Since:
- 1.4
- Version:
- 5.2
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the specified object with this sequence for equality.booleanTests whether a predicate holds for all elements of this sequence.voidfinal Tget(int index) Return the value at the givenindex.inthashCode()Returns the hash code value for this sequence.intindexWhere(Predicate<? super T> predicate, int start, int end) Returns the index of the first element on which the given predicate returnstrue, or -1 if the predicate returns false for every sequence element.intlastIndexWhere(Predicate<? super T> predicate, int start, int end) Returns the index of the last element on which the given predicate returnstrue, or -1 if the predicate returns false for every sequence element.intlength()Return the length of this sequence.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.jenetics.util.BaseSeq
isEmpty, iterator, listIterator, nonEmpty, spliterator, streamMethods inherited from interface io.jenetics.util.Seq
append, append, apply, asISeq, asList, asMSeq, contains, indexOf, indexOf, indexOf, indexWhere, indexWhere, isSorted, isSorted, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, map, parallelStream, prepend, prepend, size, subSeq, subSeq, toArray, toArray, toArray, toString, toString
-
Field Details
-
array
-
-
Constructor Details
-
ArraySeq
-
-
Method Details
-
get
Description copied from interface:BaseSeqReturn the value at the givenindex. -
forEach
-
forAll
Description copied from interface:SeqTests whether a predicate holds for all elements of this sequence. -
indexWhere
Description copied from interface:SeqReturns the index of the first element on which the given predicate returns
true, or -1 if the predicate returns false for every sequence element.// Finding index of first null value. final int index = seq.indexOf(o -> o == null); // Assert of no null values. assert (sequence.indexOf(o -> o == null) == -1);- Specified by:
indexWherein interfaceSeq<T>- Parameters:
predicate- the search predicate.start- the search start indexend- the search end index- Returns:
- the index of the first element on which the given predicate
returns
true, or -1 if the predicate returnsfalsefor every sequence element.
-
lastIndexWhere
Description copied from interface:SeqReturns the index of the last element on which the given predicate returnstrue, or -1 if the predicate returns false for every sequence element.- Specified by:
lastIndexWherein interfaceSeq<T>- Parameters:
predicate- the search predicate.start- the search start indexend- the search end index- Returns:
- the index of the last element on which the given predicate
returns
true, or -1 if the predicate returns false for every sequence element.
-
length
Description copied from interface:BaseSeqReturn the length of this sequence. Once the sequence is created, the length can't be changed. -
toString
-
hashCode
Description copied from interface:SeqReturns the hash code value for this sequence. The hash code is defined as followed:int hashCode = 1; final Iterator<E> it = seq.iterator(); while (it.hasNext()) { final E obj = it.next(); hashCode = 31*hashCode + (obj == null ? 0 : obj.hashCode()); } -
equals
Description copied from interface:SeqCompares the specified object with this sequence for equality. Returns true if and only if the specified object is also a sequence, both sequence have the same size, and all corresponding pairs of elements in the two sequences are equal. (Two elements e1 and e2 are equal if (e1==null ? e2==null : e1.equals(e2)).) This definition ensures that the equals method works properly across different implementations of the Seq interface.
-