jmri.jmrix
Class AbstractPortController

Show UML class diagram
java.lang.Object
  extended by jmri.jmrix.AbstractPortController
All Implemented Interfaces:
PortAdapter
Direct Known Subclasses:
AbstractNetworkPortController, AbstractSerialPortController

public abstract class AbstractPortController
extends Object
implements PortAdapter

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 behaviours for those, so we put them here.

See Also:
SerialPortAdapter

Constructor Summary
AbstractPortController()
           
 
Method Summary
 void configureOption1(String value)
          Set the second port option.
 void configureOption2(String value)
          Set the second port option.
 String getCurrentOption1Setting()
           
 String getCurrentOption2Setting()
          Get current option 2 value
abstract  String getCurrentPortName()
           
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.
abstract  DataOutputStream getOutputStream()
           
abstract  SystemConnectionMemo getSystemConnectionMemo()
           
 String option1Name()
          Get a String that says what Option 1 represents May be an empty string, but will not be null
 String option2Name()
          Get a String that says what Option 2 represents May be an empty string, but will not be null
 void setManufacturer(String Manufacturer)
          Set the System Manufacturers Name
 boolean status()
          Query the status of this connection.
 String[] validOption1()
          Get an array of valid values for "option 1"; used to display valid options.
 String[] validOption2()
          Get an array of valid values for "option 2"; used to display valid options.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.jmrix.PortAdapter
configure, dispose
 

Constructor Detail

AbstractPortController

public AbstractPortController()
Method Detail

getInputStream

public abstract DataInputStream getInputStream()
Specified by:
getInputStream in interface PortAdapter

getOutputStream

public abstract DataOutputStream getOutputStream()
Specified by:
getOutputStream in interface PortAdapter

status

public boolean status()
Description copied from interface: PortAdapter
Query the status of this connection. If all OK, at least as far as is known, return true

Specified by:
status in interface PortAdapter

getCurrentPortName

public abstract String getCurrentPortName()
Specified by:
getCurrentPortName in interface PortAdapter

validOption1

public String[] validOption1()
Get an array of valid values for "option 1"; used to display valid options. May not be null, but may have zero entries

Specified by:
validOption1 in interface PortAdapter

option1Name

public String option1Name()
Get a String that says what Option 1 represents May be an empty string, but will not be null

Specified by:
option1Name in interface PortAdapter

configureOption1

public void configureOption1(String value)
Set the second port option.

Specified by:
configureOption1 in interface PortAdapter

getCurrentOption1Setting

public String getCurrentOption1Setting()
Specified by:
getCurrentOption1Setting in interface PortAdapter

validOption2

public String[] validOption2()
Get an array of valid values for "option 2"; used to display valid options. May not be null, but may have zero entries

Specified by:
validOption2 in interface PortAdapter

option2Name

public String option2Name()
Get a String that says what Option 2 represents May be an empty string, but will not be null

Specified by:
option2Name in interface PortAdapter

configureOption2

public void configureOption2(String value)
Set the second port option.

Specified by:
configureOption2 in interface PortAdapter

getCurrentOption2Setting

public String getCurrentOption2Setting()
Description copied from interface: PortAdapter
Get current option 2 value

Specified by:
getCurrentOption2Setting in interface PortAdapter

getManufacturer

public String getManufacturer()
Get and set of the Manufacturer for network (TCP/IP) based connections is handled by the ConnectionConfig code in each connector. this is here as we implement the serialdriveradpter.

Specified by:
getManufacturer in interface PortAdapter

setManufacturer

public void setManufacturer(String Manufacturer)
Description copied from interface: PortAdapter
Set the System Manufacturers Name

Specified by:
setManufacturer in interface PortAdapter

getSystemConnectionMemo

public abstract SystemConnectionMemo getSystemConnectionMemo()
Specified by:
getSystemConnectionMemo in interface PortAdapter


Copyright © 1997 - 2010 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads