Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
API
Commits
fca66901
Commit
fca66901
authored
Apr 30, 2017
by
Clemens Krug
Browse files
Added Javadoc to class involved in the node debugging
parent
db6cbf51
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tudarmstadt/maki/simonstrator/api/NodeDebugMonitor.java
View file @
fca66901
...
@@ -8,7 +8,7 @@ import java.util.HashMap;
...
@@ -8,7 +8,7 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* Bridge to local debug monitoring. Provides logging capabilities and
* Bridge to local
node
debug monitoring. Provides logging capabilities and
* data access for per node information.
* data access for per node information.
*/
*/
public
class
NodeDebugMonitor
public
class
NodeDebugMonitor
...
@@ -45,11 +45,21 @@ public class NodeDebugMonitor
...
@@ -45,11 +45,21 @@ public class NodeDebugMonitor
}
}
/**
* Gets the data of a node separated by the classes the information came from.
* @param nodeID The node of which the information should be collected.
* @return A hashmap of hashmaps with each inner hashmap holding the information provided by one
* specific class.
*/
public
static
Map
<
Class
,
HashMap
<
String
,
Object
>>
getNodeData
(
INodeID
nodeID
)
public
static
Map
<
Class
,
HashMap
<
String
,
Object
>>
getNodeData
(
INodeID
nodeID
)
{
{
return
getDebugMonitor
().
getNodeData
(
nodeID
);
return
getDebugMonitor
().
getNodeData
(
nodeID
);
}
}
/**
* Add a listener which will be informed about data updates.
* @param listener The listener to add.
*/
public
static
void
addUpdateListener
(
NodeDebugMonitorComponent
.
NodeDebugUpdateListener
listener
)
public
static
void
addUpdateListener
(
NodeDebugMonitorComponent
.
NodeDebugUpdateListener
listener
)
{
{
getDebugMonitor
().
addUpdateListener
(
listener
);
getDebugMonitor
().
addUpdateListener
(
listener
);
...
...
src/de/tudarmstadt/maki/simonstrator/api/component/core/NodeDebugMonitorComponent.java
View file @
fca66901
...
@@ -7,27 +7,59 @@ import java.util.HashMap;
...
@@ -7,27 +7,59 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* Created by Clemens on 02.04.2017.
* The actual node debug monitoring component. As opposed to the {@link de.tudarmstadt.maki.simonstrator.api.NodeDebugMonitor}
* which only serves as a bridge, a class implementing this interface provides the actual functionality.
*/
*/
public
interface
NodeDebugMonitorComponent
extends
GlobalComponent
public
interface
NodeDebugMonitorComponent
extends
GlobalComponent
{
{
/**
* Update an entry for a node.
* @param subject The class which provided the info
* @param nodeID The node the info is about
* @param entry The string entry/key of the information
* @param value The value of the information
*/
void
update
(
Class
<?>
subject
,
INodeID
nodeID
,
String
entry
,
Object
value
);
void
update
(
Class
<?>
subject
,
INodeID
nodeID
,
String
entry
,
Object
value
);
/**
* Gets the data of a node separated by the classes the information came from.
* @param nodeID The node of which the information should be collected.
* @return A hashmap of hashmaps with each inner hashmap holding the information provided by one
* specific class.
*/
Map
<
Class
,
HashMap
<
String
,
Object
>>
getNodeData
(
INodeID
nodeID
);
Map
<
Class
,
HashMap
<
String
,
Object
>>
getNodeData
(
INodeID
nodeID
);
/**
* Add a listener which will be informed about data updates.
* @param listener The listener to add.
*/
void
addUpdateListener
(
NodeDebugUpdateListener
listener
);
void
addUpdateListener
(
NodeDebugUpdateListener
listener
);
/**
* Removes a listener so that it won't be notified anymore.
* @param listener the listener to remove
*/
void
removeUpdateListener
(
NodeDebugUpdateListener
listener
);
void
removeUpdateListener
(
NodeDebugUpdateListener
listener
);
/**
/**
* When set to true this method needs to create the
* When set to true this method needs to create the
* appropriate visualisation component.
* appropriate visualisation component.
* @param enabled
* @param enabled
wether to enable the visualisation or not
*/
*/
void
setEnableVis
(
boolean
enabled
);
void
setEnableVis
(
boolean
enabled
);
/**
* Listener for updates of the per node information.
*/
interface
NodeDebugUpdateListener
interface
NodeDebugUpdateListener
{
{
/**
* Called upon an update of the data of a node.
* @param subject The class that provided the info
* @param nodeId the node the info is about
* @param entry the actual entry/key of the info
* @param value the value of the info.
*/
void
onNodeDebugUpdate
(
Class
subject
,
INodeID
nodeId
,
String
entry
,
Object
value
);
void
onNodeDebugUpdate
(
Class
subject
,
INodeID
nodeId
,
String
entry
,
Object
value
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment