cdx
Class StateTable

java.lang.Object
  extended by cdx.StateTable

public class StateTable
extends java.lang.Object

The class StateTable records the state of the previous frame. Allocated CallSign objects and Vector3d objects for positions are held in mission memory.


Field Summary
 CallSign[] allocatedCallSigns
          The pre-allocated callsigns
 Vector3d[] allocatedVectors
          The pre-allocated vectors
 int usedSlots
          To record the used pairs of callsign/vector
 
Constructor Summary
StateTable()
          Constructor that initialise CHahsMap, callsign and vectors.
 
Method Summary
 Vector3d get(CallSign callsign)
          Method to return a position by its callsign
 java.util.Set getCallSigns()
          Return a set of all callsigns
 void put(CallSign callsign, float x, float y, float z)
          Put a callsign and the related vector(x,y,z) into the StateTable.
 Vector3d remove(CallSign callsign)
          Method to remove a postion from the StateTable by its callsign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allocatedCallSigns

public CallSign[] allocatedCallSigns
The pre-allocated callsigns


allocatedVectors

public Vector3d[] allocatedVectors
The pre-allocated vectors


usedSlots

public int usedSlots
To record the used pairs of callsign/vector

Constructor Detail

StateTable

public StateTable()
Constructor that initialise CHahsMap, callsign and vectors.

Method Detail

getCallSigns

public java.util.Set getCallSigns()
Return a set of all callsigns


put

public void put(CallSign callsign,
                float x,
                float y,
                float z)
Put a callsign and the related vector(x,y,z) into the StateTable. If the callsign has existed, it updates the value; if not, add in as a new entry.

Parameters:
callsign - a callsign of aircraft
x - x axis of the postion
y - y axis of the position
z - z axis of the position

get

public Vector3d get(CallSign callsign)
Method to return a position by its callsign

Parameters:
callsign - the callsign for aircraft
Returns:
a postion

remove

public Vector3d remove(CallSign callsign)
Method to remove a postion from the StateTable by its callsign

Parameters:
callsign - the aircraft to be removed from the table