Class AbstractInterpolationStrategy<C,​V>

  • Type Parameters:
    C - type of the coordinate, must be Comparable
    V - type of the value in the Tensor
    All Implemented Interfaces:
    InterpolationStrategy<C,​V>
    Direct Known Subclasses:
    AbstractLinearDoubleInterpolationStrategy, LinearInterpolation

    public abstract class AbstractInterpolationStrategy<C,​V>
    extends java.lang.Object
    implements InterpolationStrategy<C,​V>
    An abstract interpolation implementation that provides the basic functions like sorting the Comparable coordinate and finding the PREVIOUS/NEXT instances in the coordinates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected C findIndex​(java.util.List<C> orderedList, C referencePosition, int indexMove)
      Finds the comparable coordinate before of after the slice position.
      protected java.util.List<C> getOrderedListOfComparableCoordinate​(Tensor<V> tensorWithTheOnlyOneCoordinateOfC, C coordinateToInterpolate)
      Extracts the ordered list of the comparable coordinate along which the interpolation will be done
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractInterpolationStrategy

        public AbstractInterpolationStrategy​(java.util.Comparator<C> comparator)
    • Method Detail

      • getOrderedListOfComparableCoordinate

        protected java.util.List<C> getOrderedListOfComparableCoordinate​(Tensor<V> tensorWithTheOnlyOneCoordinateOfC,
                                                                         C coordinateToInterpolate)
        Extracts the ordered list of the comparable coordinate along which the interpolation will be done
        Parameters:
        tensorWithTheOnlyOneCoordinateOfC - tensor with only ONE coordinate
        coordinateToInterpolate - the coordinate to extract
        Returns:
        an ordered (ascending) list of the comparable coordinates
      • findIndex

        protected C findIndex​(java.util.List<C> orderedList,
                              C referencePosition,
                              int indexMove)
        Finds the comparable coordinate before of after the slice position.
        Parameters:
        orderedList - an ordered list of coordinates
        referencePosition -
        indexMove - if 0 then the PREVIOUS will be returned, if +1 the NEXT will be returned.
        Returns:
        the comparable coordinate BEFORE or AFTER the reference one.