Payload - The payload type.public final class ArraySource<Payload> extends AbstractIndexedSource<Payload>
ArraySource is an AbstractIndexedSource that is backed by
an array.| Constructor and Description |
|---|
ArraySource(Payload... array)
Creates a new
CodeSource. |
| Modifier and Type | Method and Description |
|---|---|
protected Payload |
doGet(int index)
Returns a payload value at the given index.
|
protected ProtectedBidirectionalIterator<Payload> |
doIterator(boolean reverse)
Returns a
ProtectedBidirectionalIterator. |
Payload[] |
getArray()
Returns the array of payload values this
ArraySource has been
created with. |
int |
size()
Returns the number of payload values of this
Source. |
doGetFirst, firstIndexOf, firstIndexOfMatch, get, getLast, getLast, getLastMatch, isFirst, isLast, iterator, iterator, lastIndexOf, lastIndexOfMatchcontains, containsAll, containsAll, containsMatch, createPredicate, firstIndexOf, getAll, getAllMatches, getFirst, getFirst, getFirstMatch, isEmpty, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFirst, getFirst, getFirstMatchcontains, containsAll, containsAll, containsMatch, getAll, getAllMatches, isEmptyforEach, spliteratorpublic ArraySource(Payload... array) throws IllegalArgumentException
CodeSource.array - The array of payload values to be used.IllegalArgumentException - If the given array of payload values is null.public final Payload[] getArray()
ArraySource has been
created with.public int size()
SourceSource.Source.protected Payload doGet(int index)
AbstractIndexedSourcedoGet in class AbstractIndexedSource<Payload>index - The index to be used, which is guaranteed to be not negative
and not larger then or equal to the
size of this
AbstractIndexedSource.protected ProtectedBidirectionalIterator<Payload> doIterator(boolean reverse)
AbstractIndexedSourceProtectedBidirectionalIterator.doIterator in class AbstractIndexedSource<Payload>reverse - The initial index to be used. Whether to return a
ProtectedBidirectionalIterator that iterates this
indexed source in reverse.ProtectedBidirectionalIterator.Copyright © 2016–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.