Package PamguardMVC
Class ChannelIterator<E extends PamDataUnit>
java.lang.Object
PamguardMVC.PamDataUnitIterator<E>
PamguardMVC.ChannelIterator<E>
- All Implemented Interfaces:
Iterator<E>
,ListIterator<E>
An iterator that has a bit more functionality than a basic iterator.
It's main enhancement is to use a channel map match to PamDataUnits, so that it only returns data units that have an overlap in channels with the given channel map (which could be 0xFFFFFFFF).
It also has a couple of extra searches to getPreceeding() and getFollowing() data units.
This class specifically matches the channelMap field. To match the sequenceMap, use the SequenceIterator class instead.
It's main enhancement is to use a channel map match to PamDataUnits, so that it only returns data units that have an overlap in channels with the given channel map (which could be 0xFFFFFFFF).
It also has a couple of extra searches to getPreceeding() and getFollowing() data units.
This class specifically matches the channelMap field. To match the sequenceMap, use the SequenceIterator class instead.
- Author:
- Doug Gillespie
-
Constructor Summary
ConstructorDescriptionChannelIterator
(PamDataBlock<E> pamDataBlock, int channelMap, int whereFrom) An iterator that has a bit more functionality than a basic iterator. -
Method Summary
Modifier and TypeMethodDescriptiongetFirstUnit
(int channelMap) Get the first unit for a specific channel or sequence map (any match of channels allowed).getLastUnit
(int channelMap) Get the last unit for a specific channel or sequence map (any match of channels allowed).next()
Return the next PamDataUnit, or null if there is no 'next' PamDataUnitprevious()
Return the previous PamDataUnit, or null if there is no 'previous' PamDataUnitMethods inherited from class PamguardMVC.PamDataUnitIterator
add, getChanOrSeqMap, getClosest, getFollowing, getPamDataBlock, getPreceding, getSynchObject, hasNext, hasPrevious, nextIndex, previousIndex, remove, set, setSynchObject
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ChannelIterator
An iterator that has a bit more functionality than a basic iterator.
It's main enhancement is to use a channel map match to PamDataUnits, so that it only returns data units that have an overlap in channels with the given channel map (which could be 0xFFFFFFFF).
It also has a couple of extra searches to getPreceeding() and getFollowing() data units.
This class specifically matches the channelMap field. To match the sequenceMap, use the SequenceIterator class instead.- Parameters:
pamDataBlock
- Datablock containing the datachannelMap
- channel map (requires overlap, or exact match)whereFrom
- start at beginning or end. 0 = beginning; -1 (or PamDatablock.ITERATOR_END) for the end
-
-
Method Details
-
getFirstUnit
Description copied from class:PamDataUnitIterator
Get the first unit for a specific channel or sequence map (any match of channels allowed).- Specified by:
getFirstUnit
in classPamDataUnitIterator<E extends PamDataUnit>
- Parameters:
channelMap
- channel/sequence map- Returns:
- first data unit with at least one channel matching, or null.
-
getLastUnit
Description copied from class:PamDataUnitIterator
Get the last unit for a specific channel or sequence map (any match of channels allowed).- Specified by:
getLastUnit
in classPamDataUnitIterator<E extends PamDataUnit>
- Parameters:
channelMap
- channel/sequence map- Returns:
- last data unit with at least one channel matching, or null.
-
next
Description copied from class:PamDataUnitIterator
Return the next PamDataUnit, or null if there is no 'next' PamDataUnit- Specified by:
next
in interfaceIterator<E extends PamDataUnit>
- Specified by:
next
in interfaceListIterator<E extends PamDataUnit>
- Specified by:
next
in classPamDataUnitIterator<E extends PamDataUnit>
-
previous
Description copied from class:PamDataUnitIterator
Return the previous PamDataUnit, or null if there is no 'previous' PamDataUnit- Specified by:
previous
in interfaceListIterator<E extends PamDataUnit>
- Specified by:
previous
in classPamDataUnitIterator<E extends PamDataUnit>
-