Android Open Source - webots-remote-control Communication Structure






From Project

Back to project page webots-remote-control.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project webots-remote-control 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 org.black_mesa.webots_remote_control.communication_structures;
//www.ja  v a2s .c  o m
import java.io.Serializable;

/**
 * Represents a CommunicationStructure. This can for example be a camera or a
 * robot. The implementation can, for example, hold the state of the object, or
 * be a simple instruction queue.
 * 
 * @author Ilja Kroonen
 * 
 */
public abstract class CommunicationStructure implements Serializable {
  private static final long serialVersionUID = -6066263437899074202L;
  private final int mId;

  /**
   * Instanciates the CommunicationStructure with a given identifier.
   * 
   * @param id
   *            The identifier of this CommunicationStructure. This identifier
   *            has to be unique for a server.
   */
  protected CommunicationStructure(final int id) {
    mId = id;
  }

  /**
   * Identifies the CommunicationStructure in a unique way. Normally, this id
   * is given by the server at connection, and never changes.
   * 
   * @return Id of this CommunicationStructure.
   */
  public final int getId() {
    return mId;
  }

  /**
   * This method is used to board the communication structure into a client.
   * into a Client.
   * 
   * @param previous
   *            Previous CommunicationStructure version for the same id in the
   *            boarding table of the client. This object must not be
   *            modified.
   * @return Reference to a new version that will replace the old one. The
   *         object referenced should never be modified afterwards.
   */
  public abstract CommunicationStructure board(CommunicationStructure previous);

  /**
   * Tests if the structure contains valid data.
   * 
   * @return True if the structure is valid, false if not.
   */
  public abstract boolean checkIntegrity();

  /**
   * The toString method must be redefined. It will be used as a user-friendly
   * identifier.
   * 
   * @return The string.
   */
  @Override
  public abstract String toString();
}




Java Source Code List

org.black_mesa.webots_remote_control.activities.AboutFragment.java
org.black_mesa.webots_remote_control.activities.AddServerActivity.java
org.black_mesa.webots_remote_control.activities.CameraFragment.java
org.black_mesa.webots_remote_control.activities.ConnectionFragment.java
org.black_mesa.webots_remote_control.activities.MainActivity.java
org.black_mesa.webots_remote_control.client.CamerasManager.java
org.black_mesa.webots_remote_control.client.Client.java
org.black_mesa.webots_remote_control.client.ConnectionManager.java
org.black_mesa.webots_remote_control.client.ConnectionState.java
org.black_mesa.webots_remote_control.client.package-info.java
org.black_mesa.webots_remote_control.communication_structures.CameraInstructionQueue.java
org.black_mesa.webots_remote_control.communication_structures.CameraInstruction.java
org.black_mesa.webots_remote_control.communication_structures.CommunicationStructure.java
org.black_mesa.webots_remote_control.communication_structures.package-info.java
org.black_mesa.webots_remote_control.database.DataBaseContract.java
org.black_mesa.webots_remote_control.database.DataBaseHelper.java
org.black_mesa.webots_remote_control.database.DataSource.java
org.black_mesa.webots_remote_control.database.ServerListAdapter.java
org.black_mesa.webots_remote_control.database.Server.java
org.black_mesa.webots_remote_control.listeners.CameraJoysticksViewListener.java
org.black_mesa.webots_remote_control.listeners.CameraTouchListenerV1.java
org.black_mesa.webots_remote_control.listeners.CameraTouchListenerV2.java
org.black_mesa.webots_remote_control.listeners.CameraTouchListenerV3.java
org.black_mesa.webots_remote_control.listeners.CameraTouchListenerV4.java
org.black_mesa.webots_remote_control.listeners.CameraTouchListenerV5.java
org.black_mesa.webots_remote_control.listeners.ClientListener.java
org.black_mesa.webots_remote_control.listeners.ConnectionManagerListener.java
org.black_mesa.webots_remote_control.listeners.OnListEventsListener.java
org.black_mesa.webots_remote_control.listeners.package-info.java
org.black_mesa.webots_remote_control.utils.CameraTouchHandlerV1.java
org.black_mesa.webots_remote_control.utils.CameraTouchHandlerV2.java
org.black_mesa.webots_remote_control.utils.CameraTouchHandlerV3.java
org.black_mesa.webots_remote_control.utils.CameraTouchHandlerV4.java
org.black_mesa.webots_remote_control.utils.CameraTouchHandlerV5.java
org.black_mesa.webots_remote_control.utils.package-info.java
org.black_mesa.webots_remote_control.views.CameraJoysticksView.java
org.black_mesa.webots_remote_control.views.CameraView.java