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 NumberMsg

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

All Implemented Interfaces:
  AbstractMsg

Direct Known Subclasses:
  BinaryNumberMsg

    public class NumberMsg

extends java.lang.Object
implements AbstractMsg

This message represents an number using leading-zero padding format.

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
`NumberMsg()` Constructor
`NumberMsg(byte[] number, int width, int radix)` Constructor
`NumberMsg(long number, int width, int radix)` Constructor
`NumberMsg(java.lang.String number, int width, int radix)` Constructor

Method Summary
`byte[]` | `getBytes()` Return leading-zero padding representation of an number with specified width.
`long` | `getNumber()` Returns the number.
`int` | `getRadix()` Returns the radix.
`int` | `getWidth()` Returns the width.
`void` | `setNumber(long number)` Sets the number.
`void` | `setRadix(int radix)` Sets the radix.
`void` | `setWidth(int width)` Sets the width.

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

### NumberMsg

    public NumberMsg()

  Constructor

### NumberMsg

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

  Constructor

  Parameters:
    `number` - The number
    `width` - The width
    `radix` - The radix
  Throws:
    `java.io.IOException` - on error

### NumberMsg

    public NumberMsg(java.lang.String number,
                     int width,
                     int radix)
              throws java.io.IOException

  Constructor

  Parameters:
    `number` - The number
    `width` - The width
    `radix` - The radix
  Throws:
    `java.io.IOException` - on error

### NumberMsg

    public NumberMsg(byte[] number,
                     int width,
                     int radix)
              throws java.io.IOException

  Constructor

  Parameters:
    `number` - The number in format of byte[]
    `width` - The width
    `radix` - The radix
  Throws:
    `java.io.IOException` - on error

Method Detail

### getWidth

    public int getWidth()

  Returns the width.

  Returns:
    The width

### getNumber

    public long getNumber()

  Returns the number.

  Returns:
    The number.

### getRadix

    public int getRadix()

  Returns the radix.

  Returns:
    The radix.

### setWidth

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

  Sets the width.

  Parameters:
    `width` - The width to set
  Throws:
    `java.io.IOException` - on error

### setNumber

    public void setNumber(long number)
                   throws java.io.IOException

  Sets the number.

  Parameters:
    `number` - The number to set
  Throws:
    `java.io.IOException` - on error

### setRadix

    public void setRadix(int radix)
                  throws java.io.IOException

  Sets the radix. The valid radix is in range from java.lang.Character.MIN_RADIX to java.lang.Character.MAX_RADIX.

  Parameters:
    `radix` - The radix to set
  Throws:
    `java.io.IOException` - on error

### 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`
  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