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
ConstructorsConstructorDescriptionMultiSegmentIterator(ParameterArchive parchive, ParameterId[] pids, int parameterGroupId, ParameterRetrievalOptions req) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the underlying rocks iterator if not already closedintbooleanisValid()Returnstrueif the iterator has more elements.voidnext()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, ParameterRetrievalOptions req)
-
-
Method Details
-
isValid
public boolean isValid()Description copied from interface:PeekingIteratorReturnstrueif the iterator has more elements.This method allows to verify whether the iterator has a valid value to be fetched.
- Specified by:
isValidin interfacePeekingIterator<MultiParameterValueSegment>- Returns:
trueif the iterator has more elements orfalseotherwise
-
value
Description copied from interface:PeekingIteratorReturns 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:
valuein interfacePeekingIterator<MultiParameterValueSegment>- Returns:
- the current element
-
next
public void next()Description copied from interface:PeekingIteratorMoves the iterator to the next element.If
PeekingIterator.isValid()returnsfalse, calling this method has no effect.- Specified by:
nextin interfacePeekingIterator<MultiParameterValueSegment>
-
close
public void close()Close the underlying rocks iterator if not already closed- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceParchiveIterator<MultiParameterValueSegment>
-
getParameterGroupId
public int getParameterGroupId()
-