org.xnap.util
Class LinkType

java.lang.Object
  extended by org.xnap.util.LinkType
All Implemented Interfaces:
java.lang.Comparable

public class LinkType
extends java.lang.Object
implements java.lang.Comparable

Provides a mapping between connection speed and common internet acces hardware.


Field Summary
static LinkType CABLE
          The cable link.
static LinkType[] COMMON_TYPES
          An array of common link types.
static LinkType DSL
          The DSL link.
static LinkType ISDN
          The ISDN link.
static LinkType LAN
          The local area network link.
static LinkType MODEM
          The modem link.
static LinkType T3
          The T3 link.
static LinkType UNKNOWN
          Unknown link type.
 
Constructor Summary
LinkType(java.lang.String type, int speed)
          Constructs a link speed object.
 
Method Summary
 int compareTo(java.lang.Object o)
           
static int getIndexOfType(LinkType[] types, int speed)
           
 int getSpeed()
          Returns the speed of the link type in kpbs.
static LinkType getType(int speed)
          Returns the common type that is closest to speed
static LinkType getType(LinkType[] types, int speed)
          Returns the type that is closest to speed
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final LinkType UNKNOWN
Unknown link type.


MODEM

public static final LinkType MODEM
The modem link.


ISDN

public static final LinkType ISDN
The ISDN link.


CABLE

public static final LinkType CABLE
The cable link.


DSL

public static final LinkType DSL
The DSL link.


T3

public static final LinkType T3
The T3 link.


LAN

public static final LinkType LAN
The local area network link.


COMMON_TYPES

public static final LinkType[] COMMON_TYPES
An array of common link types.

Constructor Detail

LinkType

public LinkType(java.lang.String type,
                int speed)
Constructs a link speed object.

Parameters:
type - the name of the link type.
speed - the maximum speed of the link type in kbps
Method Detail

getIndexOfType

public static int getIndexOfType(LinkType[] types,
                                 int speed)

getType

public static LinkType getType(LinkType[] types,
                               int speed)
Returns the type that is closest to speed

Parameters:
speed - the speed of the link type in kbps

getType

public static LinkType getType(int speed)
Returns the common type that is closest to speed

Parameters:
speed - the speed of the link type in kbps

getSpeed

public int getSpeed()
Returns the speed of the link type in kpbs.


compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2005 XNap Team. All Rights Reserved.