public final class StateElementAdapterHelpers extends Object
StateElementAdapters
.Modifier and Type | Method and Description |
---|---|
static ArrayList<ITimeBasedState> |
adaptEphemeris(List<ITimeBasedState> ephemeris,
List<StateElementAdapter> adapters,
CopyContext context)
Adapts the
ephemeris using the adapters provided. |
static void |
adaptState(ITimeBasedState initialState,
ITimeBasedState finalState,
List<StateElementAdapter> adapters)
A helper method to perform the default state adaptation.
|
static StateElementAdapter |
createAdapterBetweenSegments(String element,
SegmentDefinition from,
SegmentDefinition to,
EvaluatorGroup group)
A helper method to create a
StateElementAdapter from one segment to another. |
@Nullable public static StateElementAdapter createAdapterBetweenSegments(String element, @Nonnull SegmentDefinition from, @Nonnull SegmentDefinition to, @Nonnull EvaluatorGroup group)
StateElementAdapter
from one segment to another.element
- The string identification of the element being adapted.from
- The segment
to adapt the element
from.to
- The segment
to adapt the element
to.group
- The EvaluatorGroup
to use to create the adapter.StateElementAdapter
going between the two segments, or null
if
one or both of the segments does not contain that element.ArgumentNullException
- Thrown when from
, to
, or group
is null
.public static void adaptState(@Nonnull ITimeBasedState initialState, @Nonnull ITimeBasedState finalState, @Nullable List<StateElementAdapter> adapters)
initialState
and finalState
can be the same instance.initialState
- The old state whose adapted data will be put into finalState
.finalState
- The state to edit with the adapted data from initialState
.adapters
- The StateElementAdapters
to use to adapt the data in the states.ArgumentNullException
- Thrown when initialState
or finalState
is null
.@Nonnull public static ArrayList<ITimeBasedState> adaptEphemeris(@Nonnull List<ITimeBasedState> ephemeris, @Nullable List<StateElementAdapter> adapters, @Nonnull CopyContext context)
ephemeris
using the adapters
provided.
A new list of ITimeBasedStates
will be returned.
The states will have been cloned using the context
and those clones adapted,
leaving the original states alone.ephemeris
- The ephemeris to be adapted.adapters
- The adapters to adapt the ephemeris
.context
- The context to use to clone the states in the ephemeris
.ArgumentNullException
- Thrown when ephemeris
or context
is null
.