package SerialImpl;
public class AccelerometerData {
private GForceAxis x = null;
private GForceAxis y = null;
private GForceAxis z = null;
@Override
public String toString() {
return System.currentTimeMillis() + "," + this.x.toString() + "," + this.y.toString() + "," + this.z.toString();
}
public void clear()
{
this.x = null;
this.y = null;
this.z = null;
}
public GForceAxis getX()
{
if (this.x == null)
{
this.x = new GForceAxis();
}
return x;
}
public GForceAxis getY() {
if (this.y == null)
{
this.y = new GForceAxis();
}
return y;
}
public GForceAxis getZ()
{
if (this.z == null)
{
this.z = new GForceAxis();
}
return z;
}
public void setX(short x)
{
this.getX().setValue(x);
}
public void setY(short y) {
this.getY().setValue(y);
}
public void setZ(short z) {
this.getZ().setValue(z);
}
public boolean isFull()
{
return this.x != null && this.y != null && this.z != null;
}
}