Package PamguardMVC
Class SequenceIterator<E extends PamDataUnit>
java.lang.Object
PamguardMVC.PamDataUnitIterator<E>
PamguardMVC.SequenceIterator<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 matches the sequenceMap field, which may default to the channelMap if the sequenceMap == null. To match specifically to the channelMap, use the ChannelIterator 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 matches the sequenceMap field, which may default to the channelMap if the sequenceMap == null. To match specifically to the channelMap, use the ChannelIterator class instead.
- Author:
- Doug Gillespie
-
Constructor Summary
ConstructorDescriptionSequenceIterator
(PamDataBlock<E> pamDataBlock, int sequenceMap, int whereFrom) An iterator that has a bit more functionality than a basic iterator. -
Method Summary
Modifier and TypeMethodDescriptiongetFirstUnit
(int sequenceMap) Get the first unit for a specific channel or sequence map (any match of channels allowed).getLastUnit
(int sequenceMap) 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
-
SequenceIterator
An iterator that has a bit more functionality than a basic iterator.
It's main enhancement is to use a sequence map match to PamDataUnits, so that it only returns data units that have an overlap in sequence numbers with the given sequence map (which could be 0xFFFFFFFF).
It also has a couple of extra searches to getPreceeding() and getFollowing() data units.
This class matches the sequenceMap field, which may default to the channelMap if the sequenceMap == null. To match specifically to the channelMap, use the ChannelIterator class instead.- Parameters:
pamDataBlock
- Datablock containing the datasequenceMap
- sequence 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:
sequenceMap
- 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:
sequenceMap
- 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>
-