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.
-
-
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)
-
-
Method Detail
-
boundingBox
@Nonnull() final List<P> boundingBox(double range)
-
getCoordinates
@Nonnull() final Array<double> getCoordinates()
-
getCoordinate
final double getCoordinate(int dimension)
-
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- Returns:
a new position with the coordinates summed with the 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
-
-
-
-