1 /* 2 * Copyright (C) 2019 Alberto Irurueta Carro (alberto@irurueta.com) 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.irurueta.navigation.frames.converters; 17 18 import com.irurueta.navigation.frames.Frame; 19 import com.irurueta.navigation.frames.FrameType; 20 import com.irurueta.units.Time; 21 22 /** 23 * Converts between source and destination frames during a given time interval. 24 * 25 * @param <S> source frame type. 26 * @param <D> destination frame type. 27 */ 28 public interface TimeIntervalFrameConverter<S extends Frame, D extends Frame> { 29 /** 30 * Converts source frame to a new destination frame instance. 31 * 32 * @param timeInterval a time interval expressed in seconds (s). 33 * @param source source frame to convert from. 34 * @return a new destination frame instance. 35 */ 36 D convertAndReturnNew(final double timeInterval, final S source); 37 38 /** 39 * Converts source frame to a new destination frame instance. 40 * 41 * @param timeInterval a time interval. 42 * @param source source frame to convert from. 43 * @return a new destination frame instance. 44 */ 45 D convertAndReturnNew(final Time timeInterval, final S source); 46 47 /** 48 * Converts source frame to destination frame. 49 * 50 * @param timeInterval a time interval expressed in seconds (s). 51 * @param source source frame to convert from. 52 * @param destination destination frame instance to convert to. 53 */ 54 void convert(final double timeInterval, final S source, final D destination); 55 56 /** 57 * Converts source frame to destination frame. 58 * 59 * @param timeInterval a time interval. 60 * @param source source frame to convert from. 61 * @param destination destination frame instance to covert to. 62 */ 63 void convert(final Time timeInterval, final S source, final D destination); 64 65 /** 66 * Gets source frame type. 67 * 68 * @return source frame type. 69 */ 70 FrameType getSourceType(); 71 72 /** 73 * Gets destination frame type. 74 * 75 * @return destination frame type. 76 */ 77 FrameType getDestinationType(); 78 }