jmri
Class DccLocoAddress

Show UML class diagram
java.lang.Object
  extended by jmri.DccLocoAddress
All Implemented Interfaces:
LocoAddress
Direct Known Subclasses:
OpenLcbLocoAddress

public class DccLocoAddress
extends Object
implements LocoAddress

Encapsulate information for a DCC Locomotive Decoder Address. In particular, this handles the "short" (standard) vs "extended" (long) address selection. An address must be one of these, hence short vs long is encoded as a boolean. Once created, the number and long/short status cannot be changed.


Nested Class Summary
 
Nested classes/interfaces inherited from interface jmri.LocoAddress
LocoAddress.Protocol
 
Field Summary
protected  long number
           
protected  LocoAddress.Protocol protocol
           
 
Constructor Summary
DccLocoAddress(DccLocoAddress l)
           
DccLocoAddress(int number, boolean isLong)
           
DccLocoAddress(int number, LocoAddress.Protocol protocol)
           
 
Method Summary
 boolean equals(Object a)
           
 int getNumber()
           
 LocoAddress.Protocol getProtocol()
           
 int hashCode()
           
 boolean isLongAddress()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

number

protected long number

protocol

protected LocoAddress.Protocol protocol
Constructor Detail

DccLocoAddress

public DccLocoAddress(int number,
                      boolean isLong)

DccLocoAddress

public DccLocoAddress(int number,
                      LocoAddress.Protocol protocol)

DccLocoAddress

public DccLocoAddress(DccLocoAddress l)
Method Detail

equals

public boolean equals(Object a)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isLongAddress

public boolean isLongAddress()

getProtocol

public LocoAddress.Protocol getProtocol()
Specified by:
getProtocol in interface LocoAddress

getNumber

public int getNumber()
Specified by:
getNumber in interface LocoAddress


Copyright © 1997-2013 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