Class AbstractPosition

  • All Implemented Interfaces:
    it.unibo.alchemist.model.Position , java.io.Serializable

    
    public abstract class AbstractPosition<P extends Position<P>>
     implements Position<P>
                        

    N-dimensional position.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final List<P> boundingBox(double range)
      final boolean equals(Object o)
      final Array<double> getCoordinates()
      final double getCoordinate(int dimension)
      final int getDimensions()
      final double distanceTo(@Nonnull() P other)
      final int hashCode()
      String toString() Prints the coordinates.
      final P plus(@Nonnull() P other) Same as plus, with the internal representation of other.
      final P plus(@Nonnull() Array<double> other)
      final P minus(@Nonnull() P other) Same as minus, with the internal representation of other.
      final P minus(@Nonnull() Array<double> other)
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • distanceTo

         final double distanceTo(@Nonnull() P other)
      • plus

        @Nonnull() final P plus(@Nonnull() P other)

        Same as plus, with the internal representation of other.

        Parameters:
        other - the other position
        Returns:

        a new position with the coordinates summed with the other

      • plus

        @Nonnull() final P plus(@Nonnull() Array<double> other)
      • minus

        @Nonnull() final P minus(@Nonnull() P other)

        Same as minus, with the internal representation of other.

        Parameters:
        other - the other position
        Returns:

        a new position with the coordinates summed with the other

      • minus

        @Nonnull() final P minus(@Nonnull() Array<double> other)