public class Units extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BUFFER_SIZE_BYTES |
static String |
BUFFER_SIZE_PACKETS |
static String |
CAPACITY_BIT_PER_SEC |
static String |
CAPACITY_GIGABIT_PER_SEC |
static String |
CAPACITY_KILOBIT_PER_SEC |
static String |
CAPACITY_MEGABIT_PER_SEC |
static String |
DELAY_MICROSECONDS |
static String |
DELAY_MILLISECONDS |
static String |
DELAY_NANOSECONDS |
static String |
DELAY_SECONDS |
static String |
DISTANCE_KILOMETERS |
static String |
DISTANCE_METERS |
static String |
TIME_MICROSECONDS |
static String |
TIME_MILLISECONDS |
static String |
TIME_MINUTES |
static String |
TIME_SECONDS |
Modifier and Type | Method and Description |
---|---|
static float |
convertCapacityValue(float value,
String capacityUnit,
String targetCapacityUnit)
Convert a capacity value from a time unit to another
|
static float |
convertDelayValue(float value,
String delayUnit,
String targetDelayUnit)
Convert a delay value from a time unit to another
|
static float |
convertDistanceValue(float value,
String distanceUnit,
String targetDistanceUnit)
Convert a distance value from a time unit to another
|
static float |
convertTimeValue(float value,
String timeUnit,
String targetTimeUnit)
Convert a time value from a time unit to another
|
static boolean |
isValidBufferUnit(String bufferUnit)
Verify if the provided buffer size unit is valid or not.
|
static boolean |
isValidCapacityUnit(String capacityUnit)
Verify if the provided capacity unit is valid or not.
|
static boolean |
isValidDelayUnit(String delayUnit)
Verify if the provided delay unit is valid or not.
|
static boolean |
isValidDistanceUnit(String distanceUnit)
Verify if the provided capacity unit is valid or not.
|
static boolean |
isValidTimeUnit(String timeUnit)
Verify if the provided time unit is valid or not.
|
public static final String CAPACITY_GIGABIT_PER_SEC
public static final String CAPACITY_MEGABIT_PER_SEC
public static final String CAPACITY_KILOBIT_PER_SEC
public static final String CAPACITY_BIT_PER_SEC
public static final String DELAY_NANOSECONDS
public static final String DELAY_MICROSECONDS
public static final String DELAY_MILLISECONDS
public static final String DELAY_SECONDS
public static final String TIME_MICROSECONDS
public static final String TIME_MILLISECONDS
public static final String TIME_SECONDS
public static final String TIME_MINUTES
public static final String DISTANCE_METERS
public static final String DISTANCE_KILOMETERS
public static final String BUFFER_SIZE_BYTES
public static final String BUFFER_SIZE_PACKETS
public static boolean isValidTimeUnit(String timeUnit)
timeUnit
- the time unit to be tested.true
if the unit is valid, false
otherwisepublic static boolean isValidDelayUnit(String delayUnit)
delayUnit
- the delay unit to be tested.true
if the unit is valid, false
otherwisepublic static boolean isValidCapacityUnit(String capacityUnit)
capacityUnit
- the capacity unit to be tested.true
if the unit is valid, false
otherwisepublic static boolean isValidDistanceUnit(String distanceUnit)
distanceUnit
- the distance unit to be tested.true
if the unit is valid, false
otherwisepublic static boolean isValidBufferUnit(String bufferUnit)
bufferUnit
- the buffer unit to be tested.true
if the unit is valid, false
otherwisepublic static float convertTimeValue(float value, String timeUnit, String targetTimeUnit)
value
- The time value to converttimeUnit
- the original time unittargetTimeUnit
- the target time unitpublic static float convertDelayValue(float value, String delayUnit, String targetDelayUnit)
value
- The delay value to convertdelayUnit
- the original delay unittargetDelayUnit
- the target delay unitpublic static float convertCapacityValue(float value, String capacityUnit, String targetCapacityUnit)
value
- The capacity value to convertcapacityUnit
- the original capacity unittargetCapacityUnit
- the target capacity unitpublic static float convertDistanceValue(float value, String distanceUnit, String targetDistanceUnit)
value
- The capacity value to convertdistanceUnit
- the original distance unittargetDistanceUnit
- the target distance unit