be.ac.ulg.montefiore.run.totem.domain.model
Enum BandwidthUnit

java.lang.Object
  extended by java.lang.Enum<BandwidthUnit>
      extended by be.ac.ulg.montefiore.run.totem.domain.model.BandwidthUnit
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BandwidthUnit>

public enum BandwidthUnit
extends java.lang.Enum<BandwidthUnit>

An enum class that expresses bandwidth units.

Creation date: 11-Jul-2006

Author:
Ga�l Monfort (monfort@run.montefiore.ulg.ac.be)

Enum Constant Summary
BPS
           
DEFAULT_UNIT
           
GBPS
           
KBPS
           
MBPS
           
TBPS
           
 
Method Summary
 float convert(BandwidthUnit convertFrom, float number)
          Converts a float in the unit given as parameter to the unit of this enum.
static BandwidthUnit valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BandwidthUnit[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DEFAULT_UNIT

public static final BandwidthUnit DEFAULT_UNIT

BPS

public static final BandwidthUnit BPS

KBPS

public static final BandwidthUnit KBPS

MBPS

public static final BandwidthUnit MBPS

GBPS

public static final BandwidthUnit GBPS

TBPS

public static final BandwidthUnit TBPS
Method Detail

values

public static final BandwidthUnit[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(BandwidthUnit c : BandwidthUnit.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static BandwidthUnit valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

convert

public float convert(BandwidthUnit convertFrom,
                     float number)
Converts a float in the unit given as parameter to the unit of this enum.

Parameters:
convertFrom - The unit in which number must be interpreted
number - The float to convert
Returns:
the float converted in the unit of this object


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.