DataRate final
A quantity representing data rate (throughput) — the amount of digital information transferred per second.
Units are available in both metric (SI) and binary (IEC) prefix variants, and in bytes per second or bits per second. The internal base unit is bytes per second (B/s). Bit-based units use Information.BitsConversionFactor (0.125 = 1/8) as their conversion factor.
Inheritance
Object → Quantity<A extends Quantity<A>> → DataRate
Constructors
DataRate()
Implementation
DataRate(super.value, super.unit);Properties
hashCode no setter inherited
The hash code for this object.
A hash code is a single integer which represents the state of the object that affects operator == comparisons.
All objects have hash codes. The default hash code implemented by Object represents only the identity of the object, the same way as the default operator == implementation only considers objects equal if they are identical (see identityHashCode).
If operator == is overridden to use the object state instead, the hash code must also be changed to represent that state, otherwise the object cannot be used in hash based data structures like the default Set and Map implementations.
Hash codes must be the same for objects that are equal to each other according to operator ==. The hash code of an object should only change if the object changes in a way that affects equality. There are no further requirements for the hash codes. They need not be consistent between executions of the same program and there are no distribution guarantees.
Objects that are not equal are allowed to have the same hash code. It is even technically allowed that all instances have the same hash code, but if clashes happen too often, it may reduce the efficiency of hash-based data structures like HashSet or HashMap.
If a subclass overrides hashCode, it should override the operator == operator as well to maintain consistency.
Inherited from Quantity.
Implementation
@override
int get hashCode => Object.hash(value, unit);runtimeType no setter inherited
A representation of the runtime type of the object.
Inherited from Object.
Implementation
external Type get runtimeType;toBitsPerSecond no setter
Converts this to bits per second (bps).
Implementation
DataRate get toBitsPerSecond => to(bitsPerSecond).bitsPerSecond;toBytesPerSecond no setter
Converts this to bytes per second (B/s).
Implementation
DataRate get toBytesPerSecond => to(bytesPerSecond).bytesPerSecond;toExabitsPerSecond no setter
Converts this to exabits per second (Ebps) — 10¹⁸ bps.
Implementation
DataRate get toExabitsPerSecond => to(exabitsPerSecond).exabitsPerSecond;toExabytesPerSecond no setter
Converts this to exabytes per second (EB/s) — 10¹⁸ B/s.
Implementation
DataRate get toExabytesPerSecond => to(exabytesPerSecond).exabytesPerSecond;toExbibitsPerSecond no setter
Converts this to exbibits per second (Eibps) — 2⁶⁰ bps.
Implementation
DataRate get toExbibitsPerSecond => to(exbibitsPerSecond).exbibitsPerSecond;toExbibytesPerSecond no setter
Converts this to exbibytes per second (EiB/s) — 2⁶⁰ B/s.
Implementation
DataRate get toExbibytesPerSecond => to(exbibytesPerSecond).exbibytesPerSecond;toGibibitsPerSecond no setter
Converts this to gibibits per second (Gibps) — 2³⁰ bps.
Implementation
DataRate get toGibibitsPerSecond => to(gibibitsPerSecond).gibibitsPerSecond;toGibibytesPerSecond no setter
Converts this to gibibytes per second (GiB/s) — 2³⁰ B/s.
Implementation
DataRate get toGibibytesPerSecond => to(gibibytesPerSecond).gibibytesPerSecond;toGigabitsPerSecond no setter
Converts this to gigabits per second (Gbps) — 10⁹ bps.
Implementation
DataRate get toGigabitsPerSecond => to(gigabitsPerSecond).gigabitsPerSecond;toGigabytesPerSecond no setter
Converts this to gigabytes per second (GB/s) — 10⁹ B/s.
Implementation
DataRate get toGigabytesPerSecond => to(gigabytesPerSecond).gigabytesPerSecond;toKibibitsPerSecond no setter
Converts this to kibibits per second (Kibps) — 2¹⁰ bps.
Implementation
DataRate get toKibibitsPerSecond => to(kibibitsPerSecond).kibibitsPerSecond;toKibibytesPerSecond no setter
Converts this to kibibytes per second (KiB/s) — 2¹⁰ B/s.
Implementation
DataRate get toKibibytesPerSecond => to(kibibytesPerSecond).kibibytesPerSecond;toKilobitsPerSecond no setter
Converts this to kilobits per second (Kbps) — 10³ bps.
Implementation
DataRate get toKilobitsPerSecond => to(kilobitsPerSecond).kilobitsPerSecond;toKilobytesPerSecond no setter
Converts this to kilobytes per second (KB/s) — 10³ B/s.
Implementation
DataRate get toKilobytesPerSecond => to(kilobytesPerSecond).kilobytesPerSecond;toMebibitsPerSecond no setter
Converts this to mebibits per second (Mibps) — 2²⁰ bps.
Implementation
DataRate get toMebibitsPerSecond => to(mebibitsPerSecond).mebibitsPerSecond;toMebibytesPerSecond no setter
Converts this to mebibytes per second (MiB/s) — 2²⁰ B/s.
Implementation
DataRate get toMebibytesPerSecond => to(mebibytesPerSecond).mebibytesPerSecond;toMegabitsPerSecond no setter
Converts this to megabits per second (Mbps) — 10⁶ bps.
Implementation
DataRate get toMegabitsPerSecond => to(megabitsPerSecond).megabitsPerSecond;toMegabytesPerSecond no setter
Converts this to megabytes per second (MB/s) — 10⁶ B/s.
Implementation
DataRate get toMegabytesPerSecond => to(megabytesPerSecond).megabytesPerSecond;toPebibitsPerSecond no setter
Converts this to pebibits per second (Pibps) — 2⁵⁰ bps.
Implementation
DataRate get toPebibitsPerSecond => to(pebibitsPerSecond).pebibitsPerSecond;toPebibytesPerSecond no setter
Converts this to pebibytes per second (PiB/s) — 2⁵⁰ B/s.
Implementation
DataRate get toPebibytesPerSecond => to(pebibytesPerSecond).pebibytesPerSecond;toPetabitsPerSecond no setter
Converts this to petabits per second (Pbps) — 10¹⁵ bps.
Implementation
DataRate get toPetabitsPerSecond => to(petabitsPerSecond).petabitsPerSecond;toPetabytesPerSecond no setter
Converts this to petabytes per second (PB/s) — 10¹⁵ B/s.
Implementation
DataRate get toPetabytesPerSecond => to(petabytesPerSecond).petabytesPerSecond;toTebibitsPerSecond no setter
Converts this to tebibits per second (Tibps) — 2⁴⁰ bps.
Implementation
DataRate get toTebibitsPerSecond => to(tebibitsPerSecond).tebibitsPerSecond;toTebibytesPerSecond no setter
Converts this to tebibytes per second (TiB/s) — 2⁴⁰ B/s.
Implementation
DataRate get toTebibytesPerSecond => to(tebibytesPerSecond).tebibytesPerSecond;toTerabitsPerSecond no setter
Converts this to terabits per second (Tbps) — 10¹² bps.
Implementation
DataRate get toTerabitsPerSecond => to(terabitsPerSecond).terabitsPerSecond;toTerabytesPerSecond no setter
Converts this to terabytes per second (TB/s) — 10¹² B/s.
Implementation
DataRate get toTerabytesPerSecond => to(terabytesPerSecond).terabytesPerSecond;toYobibitsPerSecond no setter
Converts this to yobibits per second (Yibps) — 2⁸⁰ bps.
Implementation
DataRate get toYobibitsPerSecond => to(yobibitsPerSecond).yobibitsPerSecond;toYobibytesPerSecond no setter
Converts this to yobibytes per second (YiB/s) — 2⁸⁰ B/s.
Implementation
DataRate get toYobibytesPerSecond => to(yobibytesPerSecond).yobibytesPerSecond;toYottabitsPerSecond no setter
Converts this to yottabits per second (Ybps) — 10²⁴ bps.
Implementation
DataRate get toYottabitsPerSecond => to(yottabitsPerSecond).yottabitsPerSecond;toYottabytesPerSecond no setter
Converts this to yottabytes per second (YB/s) — 10²⁴ B/s.
Implementation
DataRate get toYottabytesPerSecond => to(yottabytesPerSecond).yottabytesPerSecond;toZebibitsPerSecond no setter
Converts this to zebibits per second (Zibps) — 2⁷⁰ bps.
Implementation
DataRate get toZebibitsPerSecond => to(zebibitsPerSecond).zebibitsPerSecond;toZebibytesPerSecond no setter
Converts this to zebibytes per second (ZiB/s) — 2⁷⁰ B/s.
Implementation
DataRate get toZebibytesPerSecond => to(zebibytesPerSecond).zebibytesPerSecond;toZettabitsPerSecond no setter
Converts this to zettabits per second (Zbps) — 10²¹ bps.
Implementation
DataRate get toZettabitsPerSecond => to(zettabitsPerSecond).zettabitsPerSecond;toZettabytesPerSecond no setter
Converts this to zettabytes per second (ZB/s) — 10²¹ B/s.
Implementation
DataRate get toZettabytesPerSecond => to(zettabytesPerSecond).zettabytesPerSecond;unit final inherited
The unit of measure that value is expressed in.
Inherited from Quantity.
Implementation
final UnitOfMeasure<A> unit;value final inherited
The raw numeric value of this quantity expressed in unit.
Inherited from Quantity.
Implementation
final double value;Methods
equivalentTo() inherited
Returns true if this quantity represents the same physical magnitude as other, regardless of which unit each is expressed in.
Inherited from Quantity.
Implementation
bool equivalentTo(Quantity<A> other) => other.to(unit) == value;noSuchMethod() inherited
Invoked when a nonexistent method or property is accessed.
A dynamic member invocation can attempt to call a member which doesn't exist on the receiving object. Example:
dynamic object = 1;
object.add(42); // Statically allowed, run-time errorThis invalid code will invoke the noSuchMethod method of the integer 1 with an Invocation representing the .add(42) call and arguments (which then throws).
Classes can override noSuchMethod to provide custom behavior for such invalid dynamic invocations.
A class with a non-default noSuchMethod invocation can also omit implementations for members of its interface. Example:
class MockList<T> implements List<T> {
noSuchMethod(Invocation invocation) {
log(invocation);
super.noSuchMethod(invocation); // Will throw.
}
}
void main() {
MockList().add(42);
}This code has no compile-time warnings or errors even though the MockList class has no concrete implementation of any of the List interface methods. Calls to List methods are forwarded to noSuchMethod, so this code will log an invocation similar to Invocation.method(#add, [42]) and then throw.
If a value is returned from noSuchMethod, it becomes the result of the original invocation. If the value is not of a type that can be returned by the original invocation, a type error occurs at the invocation.
The default behavior is to throw a NoSuchMethodError.
Inherited from Object.
Implementation
@pragma("vm:entry-point")
@pragma("wasm:entry-point")
external dynamic noSuchMethod(Invocation invocation);to() inherited
Converts this quantity to uom and returns the raw double value.
If uom equals unit, the current value is returned unchanged.
Inherited from Quantity.
Implementation
double to(UnitOfMeasure<A> uom) => uom == unit ? value : uom.convertTo(unit.convertFrom(value));toString() inherited
A string representation of this object.
Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.
Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.
Inherited from Quantity.
Implementation
@override
String toString() => '$value ${unit.symbol}';Operators
operator +() inherited
Returns the sum of this quantity and that, expressed in unit.
that is converted to unit before adding, so mixed-unit addition is safe.
Inherited from Quantity.
Implementation
A operator +(A that) => unit.call(value + that.to(unit));operator -() inherited
Returns the difference of this quantity and that, expressed in unit.
that is converted to unit before subtracting, so mixed-unit subtraction is safe.
Inherited from Quantity.
Implementation
A operator -(A that) => unit.call(value - that.to(unit));operator <() inherited
Returns true if this quantity is less than that.
that is converted to unit before comparing.
Inherited from Quantity.
Implementation
bool operator <(A that) => value < that.to(unit);operator <=() inherited
Returns true if this quantity is less than or equal to that.
that is converted to unit before comparing.
Inherited from Quantity.
Implementation
bool operator <=(A that) => value <= that.to(unit);operator ==() inherited
The equality operator.
The default behavior for all Objects is to return true if and only if this object and other are the same object.
Override this method to specify a different equality relation on a class. The overriding method must still be an equivalence relation. That is, it must be:
Total: It must return a boolean for all arguments. It should never throw.
Reflexive: For all objects
o,o == omust be true.Symmetric: For all objects
o1ando2,o1 == o2ando2 == o1must either both be true, or both be false.Transitive: For all objects
o1,o2, ando3, ifo1 == o2ando2 == o3are true, theno1 == o3must be true.
The method should also be consistent over time, so whether two objects are equal should only change if at least one of the objects was modified.
If a subclass overrides the equality operator, it should override the hashCode method as well to maintain consistency.
Inherited from Quantity.
Implementation
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Quantity<A> && other.value == value && other.unit == unit);operator >() inherited
Returns true if this quantity is greater than that.
that is converted to unit before comparing.
Inherited from Quantity.
Implementation
bool operator >(A that) => value > that.to(unit);operator >=() inherited
Returns true if this quantity is greater than or equal to that.
that is converted to unit before comparing.
Inherited from Quantity.
Implementation
bool operator >=(A that) => value >= that.to(unit);Static Methods
parse() override
Parses s into a DataRate, returning None if parsing fails.
Implementation
static Option<DataRate> parse(String s) => Quantity.parse(s, units);Constants
bitsPerSecond
Unit for bits per second (bps).
Implementation
static const bitsPerSecond = BitsPerSecond._();bytesPerSecond
Unit for bytes per second (B/s) — the base unit of data rate.
Implementation
static const bytesPerSecond = BytesPerSecond._();exabitsPerSecond
Unit for exabits per second (Ebps) — 10¹⁸ bps.
Implementation
static const exabitsPerSecond = ExabitsPerSecond._();exabytesPerSecond
Unit for exabytes per second (EB/s) — 10¹⁸ B/s.
Implementation
static const exabytesPerSecond = ExabytesPerSecond._();exbibitsPerSecond
Unit for exbibits per second (Eibps) — 2⁶⁰ bps.
Implementation
static const exbibitsPerSecond = ExbibitsPerSecond._();exbibytesPerSecond
Unit for exbibytes per second (EiB/s) — 2⁶⁰ B/s.
Implementation
static const exbibytesPerSecond = ExbibytesPerSecond._();gibibitsPerSecond
Unit for gibibits per second (Gibps) — 2³⁰ bps.
Implementation
static const gibibitsPerSecond = GibibitsPerSecond._();gibibytesPerSecond
Unit for gibibytes per second (GiB/s) — 2³⁰ B/s.
Implementation
static const gibibytesPerSecond = GibibytesPerSecond._();gigabitsPerSecond
Unit for gigabits per second (Gbps) — 10⁹ bps.
Implementation
static const gigabitsPerSecond = GigabitsPerSecond._();gigabytesPerSecond
Unit for gigabytes per second (GB/s) — 10⁹ B/s.
Implementation
static const gigabytesPerSecond = GigabytesPerSecond._();kibibitsPerSecond
Unit for kibibits per second (Kibps) — 2¹⁰ bps.
Implementation
static const kibibitsPerSecond = KibibitsPerSecond._();kibibytesPerSecond
Unit for kibibytes per second (KiB/s) — 2¹⁰ B/s.
Implementation
static const kibibytesPerSecond = KibibytesPerSecond._();kilobitsPerSecond
Unit for kilobits per second (Kbps) — 10³ bps.
Implementation
static const kilobitsPerSecond = KilobitsPerSecond._();kilobytesPerSecond
Unit for kilobytes per second (KB/s) — 10³ B/s.
Implementation
static const kilobytesPerSecond = KilobytesPerSecond._();mebibitsPerSecond
Unit for mebibits per second (Mibps) — 2²⁰ bps.
Implementation
static const mebibitsPerSecond = MebibitsPerSecond._();mebibytesPerSecond
Unit for mebibytes per second (MiB/s) — 2²⁰ B/s.
Implementation
static const mebibytesPerSecond = MebibytesPerSecond._();megabitsPerSecond
Unit for megabits per second (Mbps) — 10⁶ bps.
Implementation
static const megabitsPerSecond = MegabitsPerSecond._();megabytesPerSecond
Unit for megabytes per second (MB/s) — 10⁶ B/s.
Implementation
static const megabytesPerSecond = MegabytesPerSecond._();pebibitsPerSecond
Unit for pebibits per second (Pibps) — 2⁵⁰ bps.
Implementation
static const pebibitsPerSecond = PebibitsPerSecond._();pebibytesPerSecond
Unit for pebibytes per second (PiB/s) — 2⁵⁰ B/s.
Implementation
static const pebibytesPerSecond = PebibytesPerSecond._();petabitsPerSecond
Unit for petabits per second (Pbps) — 10¹⁵ bps.
Implementation
static const petabitsPerSecond = PetabitsPerSecond._();petabytesPerSecond
Unit for petabytes per second (PB/s) — 10¹⁵ B/s.
Implementation
static const petabytesPerSecond = PetabytesPerSecond._();tebibitsPerSecond
Unit for tebibits per second (Tibps) — 2⁴⁰ bps.
Implementation
static const tebibitsPerSecond = TebibitsPerSecond._();tebibytesPerSecond
Unit for tebibytes per second (TiB/s) — 2⁴⁰ B/s.
Implementation
static const tebibytesPerSecond = TebibytesPerSecond._();terabitsPerSecond
Unit for terabits per second (Tbps) — 10¹² bps.
Implementation
static const terabitsPerSecond = TerabitsPerSecond._();terabytesPerSecond
Unit for terabytes per second (TB/s) — 10¹² B/s.
Implementation
static const terabytesPerSecond = TerabytesPerSecond._();units
All supported DataRate units.
Implementation
static const units = {
bytesPerSecond,
kilobytesPerSecond,
kibibytesPerSecond,
megabytesPerSecond,
mebibytesPerSecond,
gigabytesPerSecond,
gibibytesPerSecond,
terabytesPerSecond,
tebibytesPerSecond,
petabytesPerSecond,
pebibytesPerSecond,
exabytesPerSecond,
exbibytesPerSecond,
zettabytesPerSecond,
zebibytesPerSecond,
yottabytesPerSecond,
yobibytesPerSecond,
bitsPerSecond,
kilobitsPerSecond,
kibibitsPerSecond,
megabitsPerSecond,
mebibitsPerSecond,
gigabitsPerSecond,
gibibitsPerSecond,
terabitsPerSecond,
tebibitsPerSecond,
petabitsPerSecond,
pebibitsPerSecond,
exabitsPerSecond,
exbibitsPerSecond,
zettabitsPerSecond,
zebibitsPerSecond,
yottabitsPerSecond,
yobibitsPerSecond,
};yobibitsPerSecond
Unit for yobibits per second (Yibps) — 2⁸⁰ bps.
Implementation
static const yobibitsPerSecond = YobibitsPerSecond._();yobibytesPerSecond
Unit for yobibytes per second (YiB/s) — 2⁸⁰ B/s.
Implementation
static const yobibytesPerSecond = YobibytesPerSecond._();yottabitsPerSecond
Unit for yottabits per second (Ybps) — 10²⁴ bps.
Implementation
static const yottabitsPerSecond = YottabitsPerSecond._();yottabytesPerSecond
Unit for yottabytes per second (YB/s) — 10²⁴ B/s.
Implementation
static const yottabytesPerSecond = YottabytesPerSecond._();zebibitsPerSecond
Unit for zebibits per second (Zibps) — 2⁷⁰ bps.
Implementation
static const zebibitsPerSecond = ZebibitsPerSecond._();zebibytesPerSecond
Unit for zebibytes per second (ZiB/s) — 2⁷⁰ B/s.
Implementation
static const zebibytesPerSecond = ZebibytesPerSecond._();zettabitsPerSecond
Unit for zettabits per second (Zbps) — 10²¹ bps.
Implementation
static const zettabitsPerSecond = ZettabitsPerSecond._();zettabytesPerSecond
Unit for zettabytes per second (ZB/s) — 10²¹ B/s.
Implementation
static const zettabytesPerSecond = ZettabytesPerSecond._();