-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Position,java.io.Serializable
public abstract class AbstractPosition<P extends Position<P>> implements Position<P>
N-dimensional position.
-
-
Method Summary
Modifier and Type Method Description final List<P>boundingBox(double range)final booleanequals(Object o)final Array<double>getCoordinates()final doublegetCoordinate(int dim)final intgetDimensions()final doubledistanceTo(@Nonnull() P other)final inthashCode()StringtoString()Prints the coordinates. final Pplus(@Nonnull() P other)Same as plus, with the internal representation of other. final Pplus(@Nonnull() Array<double> other)final Pminus(@Nonnull() P other)Same as minus, with the internal representation of other. final Pminus(@Nonnull() Array<double> other)final Ptimes(double other)Multiplication by a number. final Pdiv(double other)Division by a number. -
-
Method Detail
-
boundingBox
final List<P> boundingBox(double range)
-
getCoordinates
@Nonnull() final Array<double> getCoordinates()
-
getCoordinate
final double getCoordinate(int dim)
-
getDimensions
final int getDimensions()
-
distanceTo
final double distanceTo(@Nonnull() P other)
-
hashCode
final int hashCode()
-
plus
@Nonnull() final P plus(@Nonnull() P other)
Same as plus, with the internal representation of other.
- Parameters:
other- the other position
-
minus
@Nonnull() final P minus(@Nonnull() P other)
Same as minus, with the internal representation of other.
- Parameters:
other- the other position
-
times
@Nonnull() final P times(double other)
Multiplication by a number.
- Parameters:
other- the number
-
-
-
-