Package org.yamcs.parameterarchive
Class MultiSegmentIterator
java.lang.Object
org.yamcs.parameterarchive.MultiSegmentIterator
- All Implemented Interfaces:
AutoCloseable
,ParchiveIterator<MultiParameterValueSegment>
,PeekingIterator<MultiParameterValueSegment>
public class MultiSegmentIterator
extends Object
implements ParchiveIterator<MultiParameterValueSegment>
Same as
SegmentIterator
but provides segments for multiple parameters from the same group in one step.
Since Yamcs 5.9.4, with the introduction of the sparseGroup, some segments in the returned MultiParameterValueSegment may be null if they contain no data
-
Constructor Summary
ConstructorDescriptionMultiSegmentIterator
(ParameterArchive parchive, ParameterId[] pids, int parameterGroupId, ParameterRequest req) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the underlying rocks iterator if not already closedint
boolean
isValid()
Returnstrue
if the iterator has more elements.void
next()
Moves the iterator to the next element.value()
Returns the current value from the iterator without advancing.
-
Constructor Details
-
MultiSegmentIterator
public MultiSegmentIterator(ParameterArchive parchive, ParameterId[] pids, int parameterGroupId, ParameterRequest req)
-
-
Method Details
-
isValid
public boolean isValid()Description copied from interface:PeekingIterator
Returnstrue
if the iterator has more elements.This method allows to verify whether the iterator has a valid value to be fetched.
- Specified by:
isValid
in interfacePeekingIterator<MultiParameterValueSegment>
- Returns:
true
if the iterator has more elements orfalse
otherwise
-
value
Description copied from interface:PeekingIterator
Returns the current value from the iterator without advancing.This method can only be called if
PeekingIterator.isValid()
returnstrue
. If called afterPeekingIterator.isValid()
returnsfalse
, this method will throw an exception.- Specified by:
value
in interfacePeekingIterator<MultiParameterValueSegment>
- Returns:
- the current element
-
next
public void next()Description copied from interface:PeekingIterator
Moves the iterator to the next element.If
PeekingIterator.isValid()
returnsfalse
, calling this method has no effect.- Specified by:
next
in interfacePeekingIterator<MultiParameterValueSegment>
-
close
public void close()Close the underlying rocks iterator if not already closed- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceParchiveIterator<MultiParameterValueSegment>
-
getParameterGroupId
public int getParameterGroupId()
-