Package 

Interface Position

  • All Implemented Interfaces:
    java.io.Serializable

    
    public interface Position<P extends Position<P>>
     implements Serializable
                        

    An interface to represent a generic coordinates system.

    • Method Summary

      Modifier and Type Method Description
      abstract List<P> boundingBox(Double range) Given a range, produces N coordinates, representing the N opposite vertices of the hypercube having the current coordinate as center and circumscribing the N-sphere defined by the range.
      abstract Double getCoordinate(Integer dim) Allows to access the value of a coordinate.
      abstract Double distanceTo(P p) Computes the distance between this position and another compatible position.
      abstract P plus(DoubleArray other) Considers both positions as vectors, and sums them.
      abstract P minus(DoubleArray other) Considers both positions as vectors, and returns the difference between this position and the passed one.
      abstract DoubleArray getCoordinates() Allows to get the position as a Number array.
      abstract Integer getDimensions()
      • Methods inherited from class java.io.Serializable

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

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

      • boundingBox

         abstract List<P> boundingBox(Double range)

        Given a range, produces N coordinates, representing the N opposite vertices of the hypercube having the current coordinate as center and circumscribing the N-sphere defined by the range. In the case of two dimensional coordinates, it must return the opposite vertices of the square circumscribing the circle with center in this position and radius range.

        Parameters:
        range -
            the radius of the hypersphere
      • getCoordinate

         abstract Double getCoordinate(Integer dim)

        Allows to access the value of a coordinate.

        Parameters:
        dim -
            the dimension. E.g., in a 2-dimensional implementation, 0
            could be the X-axis and 1 the Y-axis
      • distanceTo

         abstract Double distanceTo(P p)

        Computes the distance between this position and another compatible position.

        Parameters:
        p -
            the position you want to know the distance to
      • plus

         abstract P plus(DoubleArray other)

        Considers both positions as vectors, and sums them.

        Parameters:
        other - the other position
      • minus

         abstract P minus(DoubleArray other)

        Considers both positions as vectors, and returns the difference between this position and the passed one.

        Parameters:
        other - the other position