Class AbstractPointTranslator

    • Field Detail

      • dimensions

        protected transient Dimensions dimensions
    • Constructor Detail

      • AbstractPointTranslator

        public AbstractPointTranslator()
    • Method Detail

      • init

        public void init​(Dimensions dimensions)
        Initializes this with the given dimensions.
        Specified by:
        init in interface PointTranslator
        Parameters:
        dimensions - the dimensions of the space
      • transform

        public void transform​(double[] transformedLocation,
                              double... targetLocation)
                       throws SpatialException
        Transform the given targetLocation according to default moveTo semantics. Namely, if the target location is within the grid dimensions then that location becomes the new transformedLocation. Otherwise, this will throw a SpatialException.
        Specified by:
        transform in interface PointTranslator
        Parameters:
        transformedLocation - the coordinates once they have been transformed by this GridPointTranslator
        targetLocation - the new target location whose coordinates will be transformed
        Throws:
        SpatialException - if the transform is invalid. For example, if the new location is outside of the grid.
      • boundsCheck

        protected void boundsCheck​(int i,
                                   double value)
      • transform

        public void transform​(NdPoint transformedLocation,
                              double... targetLocation)
                       throws SpatialException
        Transform the given targetLocation according to default moveTo semantics. Namely, if the target location is within the grid dimensions then that location becomes the new transformedLocation. Otherwise, this will throw a SpatialException.
        Specified by:
        transform in interface PointTranslator
        Parameters:
        transformedLocation - the coordinates once they have been transformed by this GridPointTranslator
        targetLocation - the new target location whose coordinates will be transformed
        Throws:
        SpatialException - if the transform is invalid. For example, if the new location is outside of the grid.
      • minusEpsilon

        protected static double minusEpsilon​(double amount)