Public Member Functions | |
String | getField (String field) |
String | getOriginalMessage () |
String | getText () |
void | onClose (int code, String reason) |
void | onOpen () |
void | onTextMessage (String payload) |
void | start () |
void | stop () |
TopicManager (String topic, String url, WebSocketConnection mConnection) | |
Static Public Member Functions | |
static String | performFormatting (String string) |
Private Member Functions | |
StringBuilder | buildRecursiveList (JSONObject msg, int tab_level) throws JSONException |
String | getJSONMessageRec (JSONObject obj, String[] subfields, int index) throws JSONException |
String | parseMessage (String msg) |
Private Attributes | |
Map< String, String > | fieldMap |
WebSocketConnection | mConnection |
String | originalPayload |
String | text |
String | topic |
String | url |
Static Private Attributes | |
static final String | tabs = "\t\t\t\t\t" |
Definition at line 30 of file TopicManager.java.
edu.nimbus.glass.TopicManager.TopicManager | ( | String | topic, |
String | url, | ||
WebSocketConnection | mConnection | ||
) | [inline] |
Definition at line 41 of file TopicManager.java.
StringBuilder edu.nimbus.glass.TopicManager.buildRecursiveList | ( | JSONObject | msg, |
int | tab_level | ||
) | throws JSONException [inline, private] |
This method builds the string represenation of the message based on the current level within the message.
msg | : JSONObject - The message information of the current level. |
tab_level | : int - How deep into the message we are. |
JSONException | : Thrown in the message is malformed. |
Definition at line 153 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.getField | ( | String | field | ) | [inline] |
Get the desired field from the message that is currently being stored.
field | : String - Which field should be parsed. |
Definition at line 81 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.getJSONMessageRec | ( | JSONObject | obj, |
String[] | subfields, | ||
int | index | ||
) | throws JSONException [inline, private] |
Definition at line 185 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.getOriginalMessage | ( | ) | [inline] |
Get the raw message that was returned from the ROS server.
Definition at line 108 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.getText | ( | ) | [inline] |
Get the text value currently in the topic Manager. Updated on every message recieved.
Definition at line 99 of file TopicManager.java.
void edu.nimbus.glass.TopicManager.onClose | ( | int | code, |
String | reason | ||
) | [inline] |
Definition at line 71 of file TopicManager.java.
void edu.nimbus.glass.TopicManager.onOpen | ( | ) | [inline] |
Definition at line 50 of file TopicManager.java.
void edu.nimbus.glass.TopicManager.onTextMessage | ( | String | payload | ) | [inline] |
Definition at line 66 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.parseMessage | ( | String | msg | ) | [inline, private] |
Parse a message and return the string represenation of it.
msg | String : The message recieved over the topic. |
Definition at line 125 of file TopicManager.java.
static String edu.nimbus.glass.TopicManager.performFormatting | ( | String | string | ) | [inline, static] |
Format a string as a double and return that string.
string | String to format or leeave alone |
Definition at line 204 of file TopicManager.java.
void edu.nimbus.glass.TopicManager.start | ( | ) | [inline] |
Definition at line 112 of file TopicManager.java.
void edu.nimbus.glass.TopicManager.stop | ( | ) | [inline] |
Definition at line 116 of file TopicManager.java.
Map<String, String> edu.nimbus.glass.TopicManager.fieldMap [private] |
Definition at line 39 of file TopicManager.java.
WebSocketConnection edu.nimbus.glass.TopicManager.mConnection [private] |
Definition at line 36 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.originalPayload [private] |
Definition at line 38 of file TopicManager.java.
final String edu.nimbus.glass.TopicManager.tabs = "\t\t\t\t\t" [static, private] |
Definition at line 32 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.text [private] |
Definition at line 37 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.topic [private] |
Definition at line 34 of file TopicManager.java.
String edu.nimbus.glass.TopicManager.url [private] |
Definition at line 35 of file TopicManager.java.