jmri.jmrix.can.cbus
Class CbusAddress

java.lang.Object
  extended by jmri.jmrix.can.cbus.CbusAddress

public class CbusAddress
extends Object

Utilities for handling CBUS addresses.

CBUS frames have a one byte command and length, optionally followed by data bytes. JMRI maps these into address strings.

Forms:

Full hex string preceeded by "X"
Needs to be pairs of digits: 0123, not 123
+/-ddd
ddd is node*100,000 (a.k.a NODEFACTOR) + event
+/-nNNNeEEE
where NNN is a node number and EEE is an event number
If ddd < 65536 then the CBUS address is taken to represent a short event.

Author:
Bob Jacobsen Copyright (C) 2008, Andrew Crosland Copyright (C) 2011

Constructor Summary
CbusAddress(String s)
          Construct from string without leading system or type letters
 
Method Summary
 boolean check()
           
 boolean checkSplit()
           
 boolean equals(Object r)
          Two addresses are equal if they result in the same numeric contents
 int hashCode()
           
 CanMessage makeMessage()
           
 CbusAddress[] split()
          Split a string containing one or more addresses into individual ones.
 String toCanonicalString()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CbusAddress

public CbusAddress(String s)
Construct from string without leading system or type letters

Method Detail

equals

public boolean equals(Object r)
Two addresses are equal if they result in the same numeric contents

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

makeMessage

public CanMessage makeMessage()

check

public boolean check()

split

public CbusAddress[] split()
Split a string containing one or more addresses into individual ones.

Returns:
null if entire string can't be parsed.

checkSplit

public boolean checkSplit()

toString

public String toString()
Overrides:
toString in class Object

toCanonicalString

public String toCanonicalString()


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