Payload - The payload typepublic interface Sequence<Payload> extends IndexedSource<Payload>
Sequence is a linear data structure.| Modifier and Type | Method and Description |
|---|---|
Sequence<Payload> |
append(Payload payload)
Appends the given payload value.
|
Sequence<Payload> |
appendAll(Iterable<? extends Payload> payloads)
Appends the given payload values.
|
Sequence<Payload> |
appendAll(Payload... payloads)
Appends the given payload values.
|
Source<Payload> |
clear()
Removes all payload values.
|
boolean |
equals(Object object)
Compares the given object with this
Sequence for equality. |
int |
hashCode()
Returns the hash code of this
Sequence. |
Sequence<Payload> |
insert(int index,
Payload payload)
Inserts the given payload value at the given index.
|
Sequence<Payload> |
insertAll(int index,
Iterable<? extends Payload> payloads)
Inserts the given payload values starting at the given index.
|
Sequence<Payload> |
insertAll(int index,
Payload... payloads)
Inserts the given payload values starting at the given index.
|
Sequence<Payload> |
prepend(Payload payload)
Prepends the given payload value.
|
Sequence<Payload> |
prependAll(Iterable<? extends Payload> payloads)
Prepends the given payload values.
|
Sequence<Payload> |
prependAll(Payload... payloads)
Prepends the given payload values.
|
Payload |
remove(int index)
Removes the payload value at the given index.
|
Source<Payload> |
removeAll(Payload reference)
Removes all occurrences, by
equality, of
the given reference payload value. |
Source<Payload> |
removeAllMatches(Predicate<? super Payload> predicate)
Removes the payload values that satisfy the given
Predicate. |
Payload |
removeFirst()
Removes the first payload value.
|
Optional<Payload> |
removeFirst(Payload reference)
Removes the first occurrence, by
equality,
of the given reference payload value. |
Optional<Payload> |
removeFirstMatch(Predicate<? super Payload> predicate)
Removes the first payload value that satisfies the given
Predicate |
Payload |
removeLast()
Removes the last payload value.
|
Optional<Payload> |
removeLast(Payload reference)
Removes the last occurrence, by
equality,
of the given payload value. |
Optional<Payload> |
removeLastMatch(Predicate<? super Payload> predicate)
Removes the last payload value that satisfies the given
Predicate |
Payload |
replace(int index,
Payload replacement)
Replaces the payload value at the given index with the given replacement
payload value.
|
Source<Payload> |
replaceAll(Payload reference,
Provider<? extends Payload> provider)
Replaces all occurrences of the the given reference payload value with
payload values yielded by the given
Provider. |
Source<Payload> |
replaceAllMatches(Predicate<? super Payload> predicate,
Provider<? extends Payload> provider)
|
Payload |
replaceFirst(Payload replacement)
Replaces the first payload value with the given replacement payload
value.
|
Optional<Payload> |
replaceFirst(Payload reference,
Payload replacement)
Replaces the first occurrence of the given reference payload value with
the given replacement payload value.
|
Optional<Payload> |
replaceFirstMatch(Predicate<? super Payload> predicate,
Payload replacement)
Replaces the first payload value that satisfy the given
Predicate
with the given replacement payload value. |
Payload |
replaceLast(Payload replacement)
Replaces the last payload value with the given replacement payload value.
|
Optional<Payload> |
replaceLast(Payload reference,
Payload replacement)
Replaces last occurrence of the the given reference payload value with
the given replacement payload value.
|
Optional<Payload> |
replaceLastMatch(Predicate<? super Payload> predicate,
Payload replacement)
Replaces the last payload value that satisfy the given
Predicate
with the given replacement payload value. |
Source<Payload> |
retainAll(Payload reference)
Removes all but the given payload value.
|
Source<Payload> |
retainAllMatches(Predicate<? super Payload> predicate)
Removes all but the payload values that satisfy the given
Predicate. |
firstIndexOf, firstIndexOfMatch, get, getFirst, getFirst, getFirstMatch, getLast, getLast, getLastMatch, isFirst, isLast, iterator, lastIndexOf, lastIndexOfMatchcontains, containsAll, containsAll, containsMatch, getAll, getAllMatches, isEmpty, sizeiteratoriteratorforEach, spliteratorSequence<Payload> insert(int index, Payload payload) throws IllegalArgumentException, IndexOutOfBoundsException
index - The index to be used.payload - The payload value to be inserted.Sequence.IllegalArgumentException - If the given payload value is null and this
Sequence doesn't allow a null to be added.IndexOutOfBoundsException - If the given index is negative or larger the the
size of this SequenceSequence<Payload> insertAll(int index, Payload... payloads) throws IllegalArgumentException, IndexOutOfBoundsException
index - The index to be used.payloads - The array of payload values to be inserted.Sequence.IllegalArgumentException - If the given array of payload values is null or if
any of the given payload values is null and this
Sequence doesn't allow a null to be added.IndexOutOfBoundsException - If the given index is negative or larger the the
size of this SequenceSequence<Payload> insertAll(int index, Iterable<? extends Payload> payloads) throws IllegalArgumentException, IndexOutOfBoundsException
index - The index to be used.payloads - The Iterable of payload values to be inserted.Sequence.IllegalArgumentException - If the given Iterable of payload values is
null or if any of the given payload values is
null and this Sequence doesn't allow a
null to be added.IndexOutOfBoundsException - If the given index is negative or larger the the
size of this SequenceSequence<Payload> prepend(Payload payload) throws IllegalArgumentException
payload - The payload value to be prepended.Sequence.IllegalArgumentException - If the given payload value is null and this
Sequence doesn't allow a null to be added.Sequence<Payload> prependAll(Payload... payloads) throws IllegalArgumentException
payloads - The array of payload values to be inserted.Sequence.IllegalArgumentException - If the given array of payload values is null or if
any of the given payload values is null and this
Sequence doesn't allow a null to be added.Sequence<Payload> prependAll(Iterable<? extends Payload> payloads) throws IllegalArgumentException
payloads - The Iterable of payload values to be inserted.Sequence.IllegalArgumentException - If the given Iterable of payload values is
null or if any of the given payload values is
null and this Sequence doesn't allow a
null to be added.Sequence<Payload> append(Payload payload) throws IllegalArgumentException
payload - The payload value to be appended.Sequence.IllegalArgumentException - If the given payload value is null and this
Sequence doesn't allow a null to be added.Sequence<Payload> appendAll(Payload... payloads) throws IllegalArgumentException
payloads - The array of payload values to be appended.Sequence.IllegalArgumentException - If the given array of payload values is null or if
any of the given payload values is null and this
Sequence doesn't allow a null to be added.Sequence<Payload> appendAll(Iterable<? extends Payload> payloads) throws IllegalArgumentException
payloads - The Iterable of payload values to be appended.Sequence.IllegalArgumentException - If the given Iterable of payload values is
null or if any of the given payload values is
null and this Sequence doesn't allow a
null to be added.Payload remove(int index) throws IndexOutOfBoundsException
index - The index to be used.IndexOutOfBoundsException - If the given index is negative or if the given index is
larger or equal to the size of this
Sequence.Payload removeFirst() throws NoSuchElementException
NoSuchElementException - If this Sequence is empty.Optional<Payload> removeFirst(Payload reference)
equality,
of the given reference payload value.reference - The reference payload to be removed.Optional yielding the removed payload value.Optional<Payload> removeFirstMatch(Predicate<? super Payload> predicate) throws IllegalArgumentException
Predicatepredicate - The Predicate to be used.Optional yielding the removed payload value.IllegalArgumentException - If the given predicate is null.Payload removeLast() throws NoSuchElementException
NoSuchElementException - If this Sequence is empty.Optional<Payload> removeLast(Payload reference)
equality,
of the given payload value.reference - The reference payload to be removed.Optional yielding the removed payload value.Optional<Payload> removeLastMatch(Predicate<? super Payload> predicate) throws IllegalArgumentException
Predicatepredicate - The Predicate to be used.Optional yielding the removed payload value.IllegalArgumentException - If the given predicate is null.Source<Payload> removeAll(Payload reference)
equality, of
the given reference payload value.reference - The reference payload to be removed.Source yielding the removed payload values.Source<Payload> removeAllMatches(Predicate<? super Payload> predicate) throws IllegalArgumentException
Predicate.predicate - The Predicate to be used.Source yielding the removed payload values.IllegalArgumentException - If the given Predicate is null.Source<Payload> retainAll(Payload reference)
reference - The reference payload values to be retained.Source yielding the removed payload values.Source<Payload> retainAllMatches(Predicate<? super Payload> predicate) throws IllegalArgumentException
Predicate.predicate - The Predicate to be used.Source yielding the removed payload values.IllegalArgumentException - If the given Predicate is null.Source<Payload> clear()
Source yielding the removed payload values.Payload replace(int index, Payload replacement) throws IllegalArgumentException, IndexOutOfBoundsException
index - The index to be used.replacement - The replacement payload value to be used.IllegalArgumentException - If the given replacement payload value is null and
this IndexedSource doesn't allow a null to
be added.IndexOutOfBoundsException - If the given index is negative or if the given index is
larger or equal to the size of
this IndexedSource.Payload replaceFirst(Payload replacement) throws IllegalArgumentException, NoSuchElementException
replacement - The replacement payload value to be used.IllegalArgumentException - If the given replacement payload value is null and
this IndexedSource doesn't allow a null to
be added.NoSuchElementException - If this IndexedSource is
empty.Optional<Payload> replaceFirst(Payload reference, Payload replacement) throws IllegalArgumentException
reference - The reference payload value to be used.replacement - The replacement payload to be used.Optional yielding the removed payload value, if any.IllegalArgumentException - If the given replacement payload value is null and
this IndexedSource doesn't allow a null to
be added.Optional<Payload> replaceFirstMatch(Predicate<? super Payload> predicate, Payload replacement) throws IllegalArgumentException
Predicate
with the given replacement payload value.predicate - The Predicate to be used.replacement - The replacement payload to be used.Optional yielding the removed payload value, if any.IllegalArgumentException - If the give Predicate is null or if the
given replacement payload value is null and this
IndexedSource doesn't allow a null to be
added.Payload replaceLast(Payload replacement) throws IllegalArgumentException, NoSuchElementException
replacement - The replacement payload value to be used.IllegalArgumentException - If the given replacement payload value is null and
this IndexedSource doesn't allow a null to
be added.NoSuchElementException - If this IndexedSource is
empty.Optional<Payload> replaceLast(Payload reference, Payload replacement) throws IllegalArgumentException
reference - The replacement reference payload value to be used.replacement - The payload to be used.Optional yielding the removed payload value, if any.IllegalArgumentException - If the given replacement payload value is null and
this IndexedSource doesn't allow a null to
be added.Optional<Payload> replaceLastMatch(Predicate<? super Payload> predicate, Payload replacement) throws IllegalArgumentException
Predicate
with the given replacement payload value.predicate - The Predicate to be used.replacement - The replacement payload to be used.Optional yielding the removed payload value, if any.IllegalArgumentException - If the give Predicate is null or if the
given replacement payload value is null and this
IndexedSource doesn't allow a null to be
added.Source<Payload> replaceAll(Payload reference, Provider<? extends Payload> provider) throws IllegalArgumentException, ProvisioningException
Provider.reference - The reference payload value to be used.provider - The Provider to be used.Source yielding the replaced payload values.IllegalArgumentException - If the given Provider is null.ProvisioningException - If the given Provider yields null and this
IndexedSource doesn't allow a null to be
added.Source<Payload> replaceAllMatches(Predicate<? super Payload> predicate, Provider<? extends Payload> provider) throws IllegalArgumentException, ProvisioningException
Predicate with
payload values yielded by the given Provider.predicate - The Predicate to be used.provider - The Provider to be used.Source yielding the replaced payload values.IllegalArgumentException - If the give Predicate is null or if the
given Provider is null.ProvisioningException - If the given Provider yields null and this
IndexedSource doesn't allow a null to be
added.int hashCode()
Sequence.
The hash code of a Sequence is defined to be the result of the
following calculation:
int hashCode = 1;
Iterator<Payload> iterator = sequence.iterator();
while (iterator.hasNext()) {
Payload payload = iterator.next();
hashCode = 31 * hashCode + (null == payload ? 0 : payload.hashCode());
}
boolean equals(Object object)
Copyright © 2016–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.