Skip to content

Commit

Permalink
javadoc lint grapevine
Browse files Browse the repository at this point in the history
  • Loading branch information
icklesteve committed May 10, 2020
1 parent 85e9a6e commit 0803563
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void setTrafficController(SerialTrafficController tc){

/**
* Get the traffic controller instance associated with this connection memo.
* @return traffic controller, one is provided if null.
*/
public SerialTrafficController getTrafficController(){
if (tc == null) {
Expand Down Expand Up @@ -97,6 +98,7 @@ public void configureManagers() {
* Provide access to the SensorManager for this particular connection.
* <p>
* NOTE: SensorManager defaults to NULL
* @return sensor manager.
*/
public SensorManager getSensorManager() {
log.debug(sensorManager != null ? "getSensorManager OK": "getSensorManager returned NULL");
Expand All @@ -114,6 +116,7 @@ public void setSensorManager(SerialSensorManager s) {
* Provide access to the TurnoutManager for this particular connection.
* <p>
* NOTE: TurnoutManager defaults to NULL
* @return turnout manager.
*/
public TurnoutManager getTurnoutManager() {
log.debug(turnoutManager != null ? "getTurnoutManager OK": "getTurnoutManager returned NULL");
Expand All @@ -131,6 +134,7 @@ public void setTurnoutManager(SerialTurnoutManager t) {
* Provide access to the LightManager for this particular connection.
* <p>
* NOTE: LightManager defaults to NULL
* @return light manager.
*/
public LightManager getLightManager() {
log.debug(lightManager != null ? "getLightManager OK": "getLightManager returned NULL");
Expand Down
28 changes: 23 additions & 5 deletions java/src/jmri/jmrix/grapevine/SerialAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ static int typeOffset(String type) {
/**
* Public static method to parse a system name and return the Serial Node.
*
* @param systemName system name.
* @param tc system connection traffic controller.
* @return 'NULL' if illegal systemName format or if the node is not found
*/
public static SerialNode getNodeFromSystemName(String systemName, SerialTrafficController tc) {
Expand Down Expand Up @@ -229,6 +231,8 @@ public static SerialNode getNodeFromSystemName(String systemName, SerialTrafficC
* Public static method to parse a system name and return the bit number.
* Notes: Bits are numbered from 1.
*
* @param systemName system name.
* @param prefix unused.
* @return 0 if an error is found
*/
public static int getBitFromSystemName(String systemName, String prefix) {
Expand Down Expand Up @@ -263,6 +267,8 @@ public static int getBitFromSystemName(String systemName, String prefix) {
* <p>
* Note: Nodes are numbered from 1.
*
* @param systemName system name.
* @param prefix unused.
* @return node number. If an error is found, returns -1
*/
public static int getNodeAddressFromSystemName(String systemName, String prefix) {
Expand Down Expand Up @@ -532,8 +538,12 @@ public static NameValidity validSystemNameFormat(@Nonnull String systemName, cha
/**
* Public static method to validate system name for configuration.
*
* @return 'true' if system name has a valid meaning in current configuration, else
* returns 'false'
* @param systemName system name to validate.
* @param type bean type, S, T or L.
* @param tc system connection traffic controller.
* @return 'true' if system name has a valid meaning in current configuration,
* else returns 'false'.
*
*/
public static boolean validSystemNameConfig(String systemName, char type, SerialTrafficController tc) {
String prefix = tc.getSystemConnectionMemo().getSystemPrefix();
Expand Down Expand Up @@ -573,9 +583,14 @@ public static boolean validSystemNameConfig(String systemName, char type, Serial

/**
* Public static method to convert any format system name for the alternate
* format (nnBnn). If the supplied system name does not have a valid format,
* or if there is no representation in the alternate naming scheme, an empty
* string is returned.
* format (nnBnn).
* <p>
* If the supplied system name does not have a valid format,
* or if there is no representation in the alternate naming scheme,
* an empty string is returned.
* @param systemName system name to convert.
* @param prefix system prefix.
* @return alternate string.
*/
public static String convertSystemNameToAlternate(String systemName, String prefix) {
// ensure that input system name has a valid format
Expand Down Expand Up @@ -606,6 +621,9 @@ public static String convertSystemNameToAlternate(String systemName, String pref
* If the supplied system name does not have a valid format, an empty string
* is returned. Otherwise a normalized name is returned in the same format
* as the input name.
* @param systemName system name to normalize.
* @param prefix system prefix.
* @return normalized string.
*/
public static String normalizeSystemName(String systemName, String prefix) {
// ensure that input system name has a valid format
Expand Down
8 changes: 6 additions & 2 deletions java/src/jmri/jmrix/grapevine/SerialMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public int getAddr() {

/**
* For Grapevine, which doesn't have a data poll, the poll operation is only
* used to see that the nodes are present. This is done by sending a "get
* software version" command.
* used to see that the nodes are present.
* This is done by sending a "get software version" command.
* @param addr address to poll.
* @return serial message to poll data.
*/
static public SerialMessage getPoll(int addr) {
// eventually this will have to include logic for reading
Expand Down Expand Up @@ -138,6 +140,7 @@ public void setParity(int start) {
* Set the number of characters expected back from the command station.
* Normally four, this is used to set other lengths for special cases, like
* a reply to a poll (software version) message.
* @param len reply length.
*/
public void setReplyLen(int len) {
replyLen = len;
Expand All @@ -149,6 +152,7 @@ public int getReplyLen() {

/**
* Format the reply as human-readable text.
* @return human-readable text of reply.
*/
public String format() {
if (getNumDataElements() == 8) {
Expand Down
3 changes: 3 additions & 0 deletions java/src/jmri/jmrix/grapevine/SerialNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static public String[] getBoardNames() {
* Assumes a node address of 1, and a node type of 0 (NODE2002V6).
* If this constructor is used, actual node address must be set using
* 'setNodeAddress()', and actual node type using 'setNodeType()'
* @param tc system connection traffic controller.
*/
public SerialNode(SerialTrafficController tc) {
this(1, tc);
Expand Down Expand Up @@ -172,13 +173,15 @@ public void resetMustSend() {

/**
* Get node type.
* @return node type, e.g. NODE2002V1 or NODE2002V6.
*/
public int getNodeType() {
return (nodeType);
}

/**
* Set node type.
* @param type node type, e.g. NODE2002V1 or NODE2002V6.
*/
@SuppressWarnings("fallthrough")
@SuppressFBWarnings(value = "SF_SWITCH_FALLTHROUGH")
Expand Down
2 changes: 2 additions & 0 deletions java/src/jmri/jmrix/grapevine/SerialReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public SerialReply(String s) {

/**
* Is reply to poll message.
* @return true if reply to a poll message, else false.
*/
public int getAddr() {
return getElement(0) & 0x7F;
Expand Down Expand Up @@ -109,6 +110,7 @@ public void setNumDataElements(int len) {
* <p>
* Since Grapevine doesn't distinguish between message and reply, this uses
* the Message method.
* @return human readable text of reply.
*/
@SuppressWarnings("fallthrough")
@SuppressFBWarnings(value = "SF_SWITCH_FALLTHROUGH")
Expand Down
1 change: 1 addition & 0 deletions java/src/jmri/jmrix/grapevine/SerialSensorManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public void reply(SerialReply r) {

/**
* Register any orphan Sensors when a new Serial Node is created.
* @param node node to register sensors for.
*/
@SuppressWarnings("deprecation") // needs careful unwinding for Set operations
public void registerSensorsForNode(SerialNode node) {
Expand Down
2 changes: 2 additions & 0 deletions java/src/jmri/jmrix/grapevine/SerialTrafficController.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public SerialTrafficController(GrapevineSystemConnectionMemo adaptermemo) {

/**
* Get minimum address of an Grapevine node as set on this TrafficController.
* @return minimum node address.
*/
public int getMinimumNodeAddress() {
return minNode;
Expand Down Expand Up @@ -88,6 +89,7 @@ public synchronized void removeSerialListener(SerialListener l) {

/**
* Set up for initialization of a Serial node.
* @param node node to initialize.
*/
public void initializeSerialNode(SerialNode node) {
synchronized (this) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public class NodeConfigFrame extends jmri.util.JmriJFrame {
protected String editStatus3 = Bundle.getMessage("NotesEdit3");

/**
* Constructor method
* Constructor method.
* @param _memo system connection.
*/
public NodeConfigFrame(GrapevineSystemConnectionMemo _memo) {
super();
Expand Down Expand Up @@ -223,6 +224,7 @@ public void actionPerformed(ActionEvent e) {

/**
* Set the node number.
* @param node node address.
*/
public void setNodeAddress(int node) {
nodeAddrSpinner.setValue(node);
Expand Down
3 changes: 2 additions & 1 deletion java/src/jmri/jmrix/grapevine/nodetable/NodeTablePane.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class NodeTablePane extends javax.swing.JPanel implements jmri.jmrix.grap
private GrapevineSystemConnectionMemo memo = null;

/**
* Constructor method
* Constructor method.
* @param _memo system connection.
*/
public NodeTablePane(GrapevineSystemConnectionMemo _memo) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig
/**
* Ctor for an object being created during load process; Swing init is
* deferred.
* @param p serial port adapter.
*/
public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
super(p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class ConnectionConfig extends jmri.jmrix.AbstractSimulatorConnectionConf
/**
* Ctor for an object being created during load process; Swing init is
* deferred.
* @param p serial port adapter.
*/
public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
super(p);
Expand Down

0 comments on commit 0803563

Please sign in to comment.