Android Open Source - rcdroid Coordinate






From Project

Back to project page rcdroid.

License

The source code is released under:

Copyright (c) 2013, Jamie Furness (jamie@jamierf.co.uk) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following...

If you think the Android project rcdroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jamierf.rcdroid.input.api;
//w w w.j a va2s.  c o m
import com.google.common.base.Objects;

public class Coordinate {

    public static final Coordinate NO_COORDINATES = new Coordinate(0, 0, 0);

    private float x;
    private float y;
    private float z;

    public Coordinate(float x, float y, float z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public Coordinate set(Coordinate coordinate) {
        return this.set(coordinate.x, coordinate.y, coordinate.z);
    }

    public Coordinate set(float x, float y, float z) {
        this.x = x;
        this.y = y;
        this.z = z;

        return this;
    }

    public Coordinate add(Coordinate coordinate) {
        return this.add(coordinate.x, coordinate.y, coordinate.z);
    }

    public Coordinate add(float x, float y, float z) {
        this.x += x;
        this.y += y;
        this.z += z;

        return this;
    }

    public float getX() {
        return x;
    }

    public float getY() {
        return y;
    }

    public float getZ() {
        return z;
    }

    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                .add("x", x)
                .add("y", y)
                .add("z", z)
                .toString();
    }
}




Java Source Code List

com.jamierf.rcdroid.CarActivity.java
com.jamierf.rcdroid.CarService.java
com.jamierf.rcdroid.config.CarConfig.java
com.jamierf.rcdroid.config.ServoConfig.java
com.jamierf.rcdroid.config.WebUIConfig.java
com.jamierf.rcdroid.http.Packet.java
com.jamierf.rcdroid.http.WebController.java
com.jamierf.rcdroid.http.handler.AssetResourceHandler.java
com.jamierf.rcdroid.http.handler.ControlProtocolHandler.java
com.jamierf.rcdroid.http.handler.JsonPOJOHandler.java
com.jamierf.rcdroid.http.listener.ClientListener.java
com.jamierf.rcdroid.http.listener.PacketListener.java
com.jamierf.rcdroid.input.SensorController.java
com.jamierf.rcdroid.input.api.BatteryStatus.java
com.jamierf.rcdroid.input.api.Coordinate.java
com.jamierf.rcdroid.input.sensor.AbstractSensor.java
com.jamierf.rcdroid.input.sensor.AccelerationSensor.java
com.jamierf.rcdroid.input.sensor.BatterySensor.java
com.jamierf.rcdroid.input.sensor.LocationSensor.java
com.jamierf.rcdroid.input.sensor.RotationSensor.java
com.jamierf.rcdroid.input.sensor.listener.SensorListener.java
com.jamierf.rcdroid.logic.CarEngine.java
com.jamierf.rcdroid.logic.packets.AbstractServoHandler.java
com.jamierf.rcdroid.logic.packets.PlayAlarmRequestHandler.java
com.jamierf.rcdroid.logic.packets.SetRotationRequestHandler.java
com.jamierf.rcdroid.logic.packets.SetSpeedRequestHandler.java
com.jamierf.rcdroid.logic.sensors.AccelerationSensorHandler.java
com.jamierf.rcdroid.logic.sensors.BatterySensorHandler.java
com.jamierf.rcdroid.logic.sensors.LocationSensorHandler.java
com.jamierf.rcdroid.logic.sensors.RotationSensorHandler.java