public class CounterArray extends Object
A counter array consists of SpiceCommon.ctrsiz elements representing cascading counters. The fastest counter is at index 0, the slowest counter is at index CTRSIZ. At the start of counting all counter array elements are set to INTMIN. In the process of counting the fastest element is incremented by one. As with any cascading counters when the fastest counter reaches INTMAX it rolls back to INTMIN and the next counter is incremented by 1. When all counters reach INTMAX, Increment signals an error.
Constructor and Description |
---|
CounterArray(String type)
Initializes the counter taking into account if it is a subsystem counter
or an user counter.
Makes the role of ZZCTRUIN and ZZCTRSIN from the SPICE library. |
Modifier and Type | Method and Description |
---|---|
boolean |
checkAndUpdate(CounterArray newCounter)
Check and update, if needed, counter array.
|
boolean |
equals(Object obj) |
int |
hashCode() |
void |
increment()
Increment counter array.
|
public CounterArray(String type) throws PatriusException
type
- Type of CounterArrayPatriusException
- if the CounterArray type is not recognizedpublic void increment() throws PatriusException
PatriusException
- if the counter is not about to overflowpublic boolean checkAndUpdate(CounterArray newCounter)
newCounter
- to compare with the current counterCopyright © 2023 CNES. All rights reserved.