- All Implemented Interfaces:
AutoCloseable,ParchiveIterator<ParameterValueSegment>,PeekingIterator<ParameterValueSegment>
Provides objects of type ParameterValueSegment which contain multiple values of one parameter - suitable to
be used for bulk processing (e.g. downsampling or averaging).
The ParameterIterator can be used to iterate over parameters value by value (at the expense of consuming more
memory)
This iterator works like a Rocks iterator (with isValid(), next(), and value()) not like a java one. The advantage is that one can look at the current value multiple times. This property is used when merging the iterators using a priority queue.
The iterator has to be closed if it is not used until the end, otherwise a rocks iterator may be left hanging
Note about the raw values retrieval: the retrieval assumes that if raw values are requested, the parameter has raw values (this can be known from the type associated to the parameter id).
Thus, if the raw values are requested and not found in the archive, the engineering values are returned as raw values. This is an optimisation done in case the two are equal.
The iterator also sends data from RealtimeFiller if that is enabled.
-
Constructor Summary
ConstructorsConstructorDescriptionSegmentIterator(ParameterArchive parchive, ParameterId parameterId, int parameterGroupId, ParameterRequest 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
-
SegmentIterator
public SegmentIterator(ParameterArchive parchive, ParameterId parameterId, int parameterGroupId, ParameterRequest 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<ParameterValueSegment>- 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<ParameterValueSegment>- 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<ParameterValueSegment>
-
close
public void close()Close the underlying rocks iterator if not already closed- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceParchiveIterator<ParameterValueSegment>
-
getParameterGroupId
public int getParameterGroupId() -
getParameterId
-