diff options
author | 2016-09-13 11:40:12 +0800 | |
---|---|---|
committer | 2016-09-13 11:41:53 +0800 | |
commit | b731e2f1dd0972409b136aebc7b463dd72c9cfad (patch) | |
tree | 5107d7d80c19ad8076c2c97c2b5ef8d1cf3ab903 /framework/src/onos/utils/misc/src/main/java/org/onlab/util/DataRateUnit.java | |
parent | ee93993458266114c29271a481ef9ce7ce621b2a (diff) |
ONOSFW-171
O/S-SFC-ONOS scenario documentation
Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365
Signed-off-by: CNlucius <lukai1@huawei.com>
Diffstat (limited to 'framework/src/onos/utils/misc/src/main/java/org/onlab/util/DataRateUnit.java')
-rw-r--r-- | framework/src/onos/utils/misc/src/main/java/org/onlab/util/DataRateUnit.java | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/framework/src/onos/utils/misc/src/main/java/org/onlab/util/DataRateUnit.java b/framework/src/onos/utils/misc/src/main/java/org/onlab/util/DataRateUnit.java deleted file mode 100644 index d49ed7b5..00000000 --- a/framework/src/onos/utils/misc/src/main/java/org/onlab/util/DataRateUnit.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.onlab.util; - -import com.google.common.annotations.Beta; - -/** - * Data rate unit. - */ -@Beta -public enum DataRateUnit { - /** - * Bit per second. - */ - BPS(1L), - /** - * Kilobit per second. - * (Decimal/SI) - */ - KBPS(1_000L), - /** - * Megabit per second. - * (Decimal/SI) - */ - MBPS(1_000_000L), - /** - * Gigabit per second. - * (Decimal/SI) - */ - GBPS(1_000_000_000L); - - private final long multiplier; - - DataRateUnit(long multiplier) { - this.multiplier = multiplier; - } - - /** - * Returns the multiplier to use, when converting value of this unit to bps. - * - * @return multiplier - */ - public long multiplier() { - return multiplier; - } - - /** - * Converts given value in this unit to bits per seconds. - * - * @param v data rate value - * @return {@code v} in bits per seconds - */ - public long toBitsPerSecond(long v) { - return v * multiplier; - } - - /** - * Converts given value in this unit to bits per seconds. - * - * @param v data rate value - * @return {@code v} in bits per seconds - */ - public double toBitsPerSecond(double v) { - return v * multiplier; - } -} |