S
- Source value Java typeD
- Target value Java typeTimeIterator<D>
public abstract class SplitAdapterTimeIterator<S,D> extends Object implements TimeIterator<D>
The adapt function is called once per sample and its result is cached to serve multiple next or peekNext calls.
Constructor | Description |
---|---|
SplitAdapterTimeIterator(TimeIterator<S> delegate) |
Build a new adapter around the given delegate.
|
Modifier and Type | Method | Description |
---|---|---|
protected abstract List<Sample<D>> |
adapt(Sample<S> sample) |
Perform the adaptation.
|
boolean |
hasNext() |
Test if there is a next element.
|
Sample<D> |
next() |
Move forward the iterator and return the next value.
|
Sample<D> |
peekNext() |
Peek the next element without moving forward the iterator.
|
String |
toString() |
public SplitAdapterTimeIterator(TimeIterator<S> delegate)
delegate
- Source iteratorprotected abstract List<Sample<D>> adapt(Sample<S> sample)
sample
- Sample to adaptpublic final Sample<D> next() throws NoSuchElementException
TimeIterator
next
in interface TimeIterator<S>
NoSuchElementException
- If there is no next elementpublic final Sample<D> peekNext() throws NoSuchElementException
TimeIterator
peekNext
in interface TimeIterator<S>
NoSuchElementException
- If there is no next elementpublic final boolean hasNext()
TimeIterator
hasNext
in interface TimeIterator<S>
Copyright © 2019. All rights reserved.