com.sshtools.util
Class UnsignedInteger

java.lang.Object
  |
  +--java.lang.Number
        |
        +--com.sshtools.util.UnsignedInteger
All Implemented Interfaces:
java.io.Serializable

public class UnsignedInteger
extends java.lang.Number

Implements a true unsigned integer type storing the value as a series of bytes. This is helpful to the SSH API because there is no unsigned integer type in Java and all SSH integers are unsigned we need to be sure that we correclty interpret the integers send and received.

Version:
1.0
Author:
Lee David Painter ( lee@sshtools.com )
See Also:
Serialized Form

Constructor Summary
UnsignedInteger(byte[] value)
          Constructor for the UnsignedInteger32 object
UnsignedInteger(int value)
          Constructor for the UnsignedInteger32 object
UnsignedInteger(java.lang.Integer value)
          Constructor for the UnsignedInteger32 object
UnsignedInteger(long value)
          Constructor for the UnsignedInteger32 object
UnsignedInteger(java.lang.Long value)
          Constructor for the UnsignedInteger32 object
UnsignedInteger(java.lang.String value)
          Constructor for the UnsignedInteger32 object
 
Method Summary
 UnsignedInteger add(UnsignedInteger value)
          Description of the Method
 double doubleValue()
          Description of the Method
 boolean equals(int value)
          Description of the Method
 boolean equals(long value)
          Description of the Method
 boolean equals(UnsignedInteger value)
          Description of the Method
 float floatValue()
          Description of the Method
 int intValue()
          Description of the Method
 long longValue()
          Description of the Method
static void main(java.lang.String[] args)
          Description of the Method
 UnsignedInteger multiply(UnsignedInteger value)
          Description of the Method
 UnsignedInteger subtract(UnsignedInteger value)
          Description of the Method
 java.lang.String toString()
          Returns a decimal formatted string
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnsignedInteger

public UnsignedInteger(int value)
Constructor for the UnsignedInteger32 object

Parameters:
value - Description of the Parameter

UnsignedInteger

public UnsignedInteger(long value)
Constructor for the UnsignedInteger32 object

Parameters:
value - Description of the Parameter

UnsignedInteger

public UnsignedInteger(java.lang.String value)
Constructor for the UnsignedInteger32 object

Parameters:
value - Description of the Parameter

UnsignedInteger

public UnsignedInteger(java.lang.Integer value)
Constructor for the UnsignedInteger32 object

Parameters:
value - Description of the Parameter

UnsignedInteger

public UnsignedInteger(byte[] value)
Constructor for the UnsignedInteger32 object

Parameters:
value - Description of the Parameter

UnsignedInteger

public UnsignedInteger(java.lang.Long value)
Constructor for the UnsignedInteger32 object

Parameters:
value - Description of the Parameter
Method Detail

intValue

public int intValue()
Description of the Method

Specified by:
intValue in class java.lang.Number
Returns:
Description of the Return Value

floatValue

public float floatValue()
Description of the Method

Specified by:
floatValue in class java.lang.Number
Returns:
Description of the Return Value

doubleValue

public double doubleValue()
Description of the Method

Specified by:
doubleValue in class java.lang.Number
Returns:
Description of the Return Value

longValue

public long longValue()
Description of the Method

Specified by:
longValue in class java.lang.Number
Returns:
Description of the Return Value

equals

public boolean equals(UnsignedInteger value)
Description of the Method

Parameters:
value - Description of the Parameter
Returns:
Description of the Return Value

equals

public boolean equals(int value)
Description of the Method

Parameters:
value - Description of the Parameter
Returns:
Description of the Return Value

equals

public boolean equals(long value)
Description of the Method

Parameters:
value - Description of the Parameter
Returns:
Description of the Return Value

toString

public java.lang.String toString()
Returns a decimal formatted string

Overrides:
toString in class java.lang.Object
Returns:
Description of the Return Value

add

public UnsignedInteger add(UnsignedInteger value)
Description of the Method

Parameters:
value - Description of the Parameter
Returns:
Description of the Return Value

subtract

public UnsignedInteger subtract(UnsignedInteger value)
Description of the Method

Parameters:
value - Description of the Parameter
Returns:
Description of the Return Value

multiply

public UnsignedInteger multiply(UnsignedInteger value)
Description of the Method

Parameters:
value - Description of the Parameter
Returns:
Description of the Return Value

main

public static void main(java.lang.String[] args)
Description of the Method

Parameters:
args - Description of the Parameter


Copyright © 2002 Sshtools.com. All Rights Reserved.