Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.stc.connector.message.common
Class BinaryNumberMsg

    java.lang.Object
      com.stc.connector.message.common.NumberMsg
          com.stc.connector.message.common.BinaryNumberMsg

All Implemented Interfaces:
  AbstractMsg

    public class BinaryNumberMsg

extends NumberMsg

This message represents an number in binary format. The valid width of the number is 1, 2, 4, 8.

Version:
  cvs revision: $Revision: 1.6 $ Last Modified: $Date: 2008/02/29 08:59:23 $
Author:
  Harry Liu

Field Summary
`static java.lang.String` | `version`

Constructor Summary
`BinaryNumberMsg(byte[] binaryNumber)` Constructor
`BinaryNumberMsg(long number, int width)` Constructor
`BinaryNumberMsg(java.lang.String number)` Constructor

Method Summary
`byte[]` | `getBinaryNumber()` Gets the binary number.
`byte[]` | `getBytes()` Return leading-zero padding representation of an number with specified width.
`int` | `getWidth()` Returns the width.
`void` | `setBinaryNumber(byte[] binaryNumber)` Sets the binary number.
`void` | `setWidth(int width)` Sets the width.

Methods inherited from class com.stc.connector.message.common.NumberMsg
`getNumber, getRadix, setNumber, setRadix`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### version

    public static final java.lang.String version

See Also:
  Constant Field Values

Constructor Detail

### BinaryNumberMsg

    public BinaryNumberMsg(long number,
                           int width)
                    throws java.io.IOException

  Constructor

  Parameters:
    `number` - The number
    `width` - The valid width of the number is 1, 2, 4, 8.
  Throws:
    `java.io.IOException` - on error

### BinaryNumberMsg

    public BinaryNumberMsg(byte[] binaryNumber)
                    throws java.io.IOException

  Constructor

  Parameters:
    `binaryNumber` - The binary number in format of byte array. The valid length of the byte array is 1, 2, 4, 8.
  Throws:
    `java.io.IOException` - on error

### BinaryNumberMsg

    public BinaryNumberMsg(java.lang.String number)
                    throws java.io.IOException

  Constructor

  Parameters:
    `number` - The number in format of String
  Throws:
    `java.io.IOException` - on error

Method Detail

### getWidth

    public int getWidth()

  Description copied from class: `NumberMsg`
  Returns the width.

  Overrides:
    `getWidth` in class `NumberMsg`
  Returns:
    The width
  See Also:
    `NumberMsg.getWidth()`

### setWidth

    public void setWidth(int width)
                  throws java.io.IOException

  Description copied from class: `NumberMsg`
  Sets the width.

  Overrides:
    `setWidth` in class `NumberMsg`
  Parameters:
    `width` - The width to set
  Throws:
    `java.io.IOException` - on error
  See Also:
    `NumberMsg.setWidth(int)`

### getBinaryNumber

    public byte[] getBinaryNumber()

  Gets the binary number.

  Returns:
    the binary number.

### setBinaryNumber

    public void setBinaryNumber(byte[] binaryNumber)

  Sets the binary number.

  Parameters:
    `binaryNumber` - The binary number.

### getBytes

    public byte[] getBytes()
                    throws java.io.IOException

  Return leading-zero padding representation of an number with specified width.

  Specified by:
    `getBytes` in interface `AbstractMsg`
  Overrides:
    `getBytes` in class `NumberMsg`
  Returns:
    A byte array
  Throws:
    `java.io.IOException` - on error
  See Also:
    `AbstractMsg.getBytes()`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD