|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractPortController
public abstract class AbstractPortController
Provide an abstract base for *PortController classes.
This is complicated by the lack of multiple inheritance. SerialPortAdapter is an Interface, and its implementing classes also inherit from various PortController types. But we want some common behaviors for those, so we put them here.
SerialPortAdapter| Nested Class Summary | |
|---|---|
protected static class |
AbstractPortController.Option
|
| Field Summary | |
|---|---|
protected boolean |
allowConnectionRecovery
|
protected boolean |
mDisabled
|
protected String |
mManufacturer
|
protected boolean |
opened
|
protected String |
option1Name
|
protected String |
option2Name
|
protected String |
option3Name
|
protected String |
option4Name
|
protected Hashtable<String,AbstractPortController.Option> |
options
|
protected int |
reconnectinterval
|
protected int |
retryAttempts
|
| Constructor Summary | |
|---|---|
AbstractPortController()
|
|
| Method Summary | |
|---|---|
void |
configureOption1(String value)
Set the first port option. |
void |
configureOption2(String value)
Set the second port option. |
void |
configureOption3(String value)
Set the third port option. |
void |
configureOption4(String value)
Set the fourth port option. |
abstract String |
getCurrentPortName()
|
boolean |
getDisabled()
Return the disabled state of the adapter |
abstract DataInputStream |
getInputStream()
|
String |
getManufacturer()
Get and set of the Manufacturer for network (TCP/IP) based connections is handled by the ConnectionConfig code in each connector. |
String |
getOption1Name()
|
String |
getOption2Name()
|
String |
getOption3Name()
|
String |
getOption4Name()
|
String[] |
getOptionChoices(String option)
return a list of the various choices allowed with an option. |
String |
getOptionDisplayName(String option)
|
String[] |
getOptions()
Get a list of all the options configured against this adapter. |
String |
getOptionState(String option)
Get the value of a specific option |
abstract DataOutputStream |
getOutputStream()
|
abstract SystemConnectionMemo |
getSystemConnectionMemo()
|
boolean |
isOptionAdvanced(String option)
|
abstract void |
recover()
|
protected static void |
safeSleep(long milliseconds,
String s)
|
protected void |
setClosed()
|
abstract void |
setDisabled(boolean disabled)
Sets whether the connection is disabled |
void |
setManufacturer(String manufacturer)
Set the System Manufacturers Name |
protected void |
setOpened()
|
void |
setOptionState(String option,
String value)
Set the value of an option |
boolean |
status()
Query the status of this connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.jmrix.PortAdapter |
|---|
configure, connect, dispose |
| Field Detail |
|---|
protected boolean opened
protected String option1Name
protected String option2Name
protected String option3Name
protected String option4Name
protected Hashtable<String,AbstractPortController.Option> options
protected String mManufacturer
protected boolean mDisabled
protected boolean allowConnectionRecovery
protected int reconnectinterval
protected int retryAttempts
| Constructor Detail |
|---|
public AbstractPortController()
| Method Detail |
|---|
public abstract DataInputStream getInputStream()
getInputStream in interface PortAdapterpublic abstract DataOutputStream getOutputStream()
getOutputStream in interface PortAdapterpublic boolean status()
PortAdapter
status in interface PortAdapterprotected void setOpened()
protected void setClosed()
public abstract String getCurrentPortName()
getCurrentPortName in interface PortAdapterpublic void configureOption1(String value)
PortAdapter
configureOption1 in interface PortAdapterpublic void configureOption2(String value)
PortAdapter
configureOption2 in interface PortAdapterpublic void configureOption3(String value)
PortAdapter
configureOption3 in interface PortAdapterpublic void configureOption4(String value)
PortAdapter
configureOption4 in interface PortAdapterpublic String getOption1Name()
getOption1Name in interface PortAdapterpublic String getOption2Name()
getOption2Name in interface PortAdapterpublic String getOption3Name()
getOption3Name in interface PortAdapterpublic String getOption4Name()
getOption4Name in interface PortAdapterpublic String[] getOptions()
getOptions in interface PortAdapter
public void setOptionState(String option,
String value)
setOptionState in interface PortAdapterpublic String getOptionState(String option)
getOptionState in interface PortAdapterpublic String[] getOptionChoices(String option)
getOptionChoices in interface PortAdapterpublic String getOptionDisplayName(String option)
getOptionDisplayName in interface PortAdapterpublic boolean isOptionAdvanced(String option)
isOptionAdvanced in interface PortAdapterpublic String getManufacturer()
getManufacturer in interface PortAdapterpublic void setManufacturer(String manufacturer)
PortAdapter
setManufacturer in interface PortAdapterpublic boolean getDisabled()
PortAdapter
getDisabled in interface PortAdapterpublic abstract void setDisabled(boolean disabled)
PortAdapter
setDisabled in interface PortAdapterpublic abstract SystemConnectionMemo getSystemConnectionMemo()
getSystemConnectionMemo in interface PortAdapterpublic abstract void recover()
recover in interface PortAdapter
protected static void safeSleep(long milliseconds,
String s)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||