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
 
- 
Field Summary
Fields inherited from class PamguardMVC.PamDataUnitIterator
chanOrSeqMap, currentUnitTime, firstUnitTime, lastUnitTime, listIterator, pamDataBlock, synchObject - 
Constructor Summary
ConstructorsConstructorDescriptionSequenceIterator(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, setSynchObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:PamDataUnitIteratorGet the first unit for a specific channel or sequence map (any match of channels allowed).- Specified by:
 getFirstUnitin 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:PamDataUnitIteratorGet the last unit for a specific channel or sequence map (any match of channels allowed).- Specified by:
 getLastUnitin 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:PamDataUnitIteratorReturn the next PamDataUnit, or null if there is no 'next' PamDataUnit- Specified by:
 nextin interfaceIterator<E extends PamDataUnit>- Specified by:
 nextin interfaceListIterator<E extends PamDataUnit>- Specified by:
 nextin classPamDataUnitIterator<E extends PamDataUnit>
 - 
previous
Description copied from class:PamDataUnitIteratorReturn the previous PamDataUnit, or null if there is no 'previous' PamDataUnit- Specified by:
 previousin interfaceListIterator<E extends PamDataUnit>- Specified by:
 previousin classPamDataUnitIterator<E extends PamDataUnit>
 
 -