com.tractrac.clientmodule.data
Class ControlPointPositionData

java.lang.Object
  extended by com.tractrac.clientmodule.details.Attachments
      extended by com.tractrac.clientmodule.data.TimeObject
          extended by com.tractrac.clientmodule.data.Position
              extended by com.tractrac.clientmodule.data.ControlPointPositionData
All Implemented Interfaces:
java.lang.Comparable<TimeObject>

public class ControlPointPositionData
extends Position

An instance of this class represents a position for a Control Point (or one of its two buoys/marks).

The static method subscribe(com.tractrac.clientmodule.Event, com.tractrac.clientmodule.data.ICallbackData, long, long) can be used to receive positions.

Custom data may be attached to each position instance.

Version:
2.0
Author:
TracTrac

Method Summary
 boolean equals(java.lang.Object obj)
           
 int getIndex()
          Returns the index (0 or 1) of the buoy/mark that this position represents
 int hashCode()
           
static AttKey newAttKey()
           
static com.maptrack.client.io.TypeController subscribe(Event event, ICallbackData<ControlPoint,ControlPointPositionData> callback, long fromTime, long toTime)
          Subscribes to control point positions for a given Event.
 java.lang.String toString()
           
 
Methods inherited from class com.tractrac.clientmodule.data.Position
getDirection, getHeight, getLatitude, getLongitude, getSpeed
 
Methods inherited from class com.tractrac.clientmodule.data.TimeObject
compareTo, getTimestamp
 
Methods inherited from class com.tractrac.clientmodule.details.Attachments
getAttachment, setAttachment
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

newAttKey

public static AttKey newAttKey()

getIndex

public int getIndex()
Returns the index (0 or 1) of the buoy/mark that this position represents

Returns:
the index (0 or 1) of the buoy/mark that this position represents

subscribe

public static com.maptrack.client.io.TypeController subscribe(Event event,
                                                              ICallbackData<ControlPoint,ControlPointPositionData> callback,
                                                              long fromTime,
                                                              long toTime)
Subscribes to control point positions for a given Event.

The method returns immediately and the positions are subsequently sent to a given callback, as they are received.

The returned type controller should be added to a DataController.

Parameters:
event - the event from which to request the data.
callback - the callback to receive the positions
fromTime - stored positions (if supported) will be requested from this time
toTime - stored positions (if supported) will be requested before this time
Returns:
the type controller

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Position

hashCode

public int hashCode()
Overrides:
hashCode in class Position

toString

public java.lang.String toString()
Overrides:
toString in class Position