- java.lang.Object
-
- com.gluonhq.attach.accelerometer.Acceleration
-
public class Acceleration extends java.lang.Object
Represents a reading taken from theAccelerometerService
. By using a device's accelerometer the acceleration force in three physical axes can be determined.- Since:
- 3.0.0
- See Also:
AccelerometerService
-
-
Constructor Summary
Constructors Constructor Description Acceleration(double x, double y, double z, java.time.LocalDateTime timestamp)
Creates a new immutable Acceleration instance with the given x, y, z, and timestamp values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.LocalDateTime
getTimestamp()
Returns the timestamp of the readingdouble
getX()
Returns the x value of the reading.double
getY()
Returns the y value of the readingdouble
getZ()
Returns the z value of the reading
-
-
-
Constructor Detail
-
Acceleration
public Acceleration(double x, double y, double z, java.time.LocalDateTime timestamp)
Creates a new immutable Acceleration instance with the given x, y, z, and timestamp values.- Parameters:
x
- The x value of the readingy
- The y value of the readingz
- The z value of the readingtimestamp
- The instant at which the reading took place
-
-
Method Detail
-
getX
public double getX()
Returns the x value of the reading.- Returns:
- The x value of the reading.
-
getY
public double getY()
Returns the y value of the reading- Returns:
- The y value of the reading.
-
getZ
public double getZ()
Returns the z value of the reading- Returns:
- The z value of the reading.
-
getTimestamp
public java.time.LocalDateTime getTimestamp()
Returns the timestamp of the reading- Returns:
- The timestamp of the reading.
-
-