E
- public class ChannelIterator<E extends PamDataUnit>
extends java.lang.Object
implements java.util.ListIterator<E>
Constructor and Description |
---|
ChannelIterator(PamDataBlock<E> pamDataBlock,
int channelMap,
int whereFrom)
An iterator that has a bit more functionality than a basic iterator.
|
Modifier and Type | Method and Description |
---|---|
void |
add(E e) |
int |
getChannelMap() |
E |
getClosest(long timeMilliseconds,
boolean firstOrlastOk)
Get the unit closest to the given time.
|
E |
getFollowing(long timeMilliseconds,
boolean lastOk)
Get the unit immediately following or at the given time.
|
PamDataBlock<E> |
getPamDataBlock() |
E |
getPreceding(long timeMilliseconds,
boolean firstOk)
Get the unit immediately before or at the given time.
|
java.lang.Object |
getSynchObject() |
boolean |
hasNext() |
boolean |
hasPrevious() |
E |
next() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
void |
remove() |
void |
set(E e) |
void |
setSynchObject(java.lang.Object synchObject) |
public ChannelIterator(PamDataBlock<E> pamDataBlock, int channelMap, int whereFrom)
pamDataBlock
- Datablock containing the datachannelMap
- channel map (requires overlap, ot exact match)whereFrom
- start at beginning or end. 0 = beginning; -1 (or PamDatablock.ITERATOR_END) for the endpublic boolean hasNext()
hasNext
in interface java.util.Iterator<E extends PamDataUnit>
hasNext
in interface java.util.ListIterator<E extends PamDataUnit>
public E next()
next
in interface java.util.Iterator<E extends PamDataUnit>
next
in interface java.util.ListIterator<E extends PamDataUnit>
public boolean hasPrevious()
hasPrevious
in interface java.util.ListIterator<E extends PamDataUnit>
public E previous()
previous
in interface java.util.ListIterator<E extends PamDataUnit>
public E getPreceding(long timeMilliseconds, boolean firstOk)
timeMilliseconds
- time in milliseconds.firstOk
- if this is true and no unit precedes the given time, it will
return the first unit, otherwise it will return nullpublic E getFollowing(long timeMilliseconds, boolean lastOk)
timeMilliseconds
- time in milliseconds.lastOk
- if this is true and no unit precedes the given time, it will
return the last unit, otherwise it will return nullpublic E getClosest(long timeMilliseconds, boolean firstOrlastOk)
timeMilliseconds
- time in milliseconds.firstOrlastOk
- if this is true and no unit precedes the given time, it will
return the last unit, otherwise it will return nullpublic int nextIndex()
nextIndex
in interface java.util.ListIterator<E extends PamDataUnit>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<E extends PamDataUnit>
public void remove()
remove
in interface java.util.Iterator<E extends PamDataUnit>
remove
in interface java.util.ListIterator<E extends PamDataUnit>
public void set(E e)
set
in interface java.util.ListIterator<E extends PamDataUnit>
public void add(E e)
add
in interface java.util.ListIterator<E extends PamDataUnit>
public int getChannelMap()
public PamDataBlock<E> getPamDataBlock()
public java.lang.Object getSynchObject()
public void setSynchObject(java.lang.Object synchObject)
synchObject
- the synchObject to set