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()
DataRate(double value, UnitOfMeasure<DataRate> unit)Implementation
DataRate(super.value, super.unit);Properties
hashCode no setter inherited
int get hashCodeThe 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
Type get runtimeTypeA representation of the runtime type of the object.
Inherited from Object.
Implementation
external Type get runtimeType;toBitsPerSecond no setter
DataRate get toBitsPerSecondConverts this to bits per second (bps).
Implementation
DataRate get toBitsPerSecond => to(bitsPerSecond).bitsPerSecond;toBytesPerSecond no setter
DataRate get toBytesPerSecondConverts this to bytes per second (B/s).
Implementation
DataRate get toBytesPerSecond => to(bytesPerSecond).bytesPerSecond;toExabitsPerSecond no setter
DataRate get toExabitsPerSecondConverts this to exabits per second (Ebps) — 10¹⁸ bps.
Implementation
DataRate get toExabitsPerSecond => to(exabitsPerSecond).exabitsPerSecond;toExabytesPerSecond no setter
DataRate get toExabytesPerSecondConverts this to exabytes per second (EB/s) — 10¹⁸ B/s.
Implementation
DataRate get toExabytesPerSecond => to(exabytesPerSecond).exabytesPerSecond;toExbibitsPerSecond no setter
DataRate get toExbibitsPerSecondConverts this to exbibits per second (Eibps) — 2⁶⁰ bps.
Implementation
DataRate get toExbibitsPerSecond => to(exbibitsPerSecond).exbibitsPerSecond;toExbibytesPerSecond no setter
DataRate get toExbibytesPerSecondConverts this to exbibytes per second (EiB/s) — 2⁶⁰ B/s.
Implementation
DataRate get toExbibytesPerSecond => to(exbibytesPerSecond).exbibytesPerSecond;toGibibitsPerSecond no setter
DataRate get toGibibitsPerSecondConverts this to gibibits per second (Gibps) — 2³⁰ bps.
Implementation
DataRate get toGibibitsPerSecond => to(gibibitsPerSecond).gibibitsPerSecond;toGibibytesPerSecond no setter
DataRate get toGibibytesPerSecondConverts this to gibibytes per second (GiB/s) — 2³⁰ B/s.
Implementation
DataRate get toGibibytesPerSecond => to(gibibytesPerSecond).gibibytesPerSecond;toGigabitsPerSecond no setter
DataRate get toGigabitsPerSecondConverts this to gigabits per second (Gbps) — 10⁹ bps.
Implementation
DataRate get toGigabitsPerSecond => to(gigabitsPerSecond).gigabitsPerSecond;toGigabytesPerSecond no setter
DataRate get toGigabytesPerSecondConverts this to gigabytes per second (GB/s) — 10⁹ B/s.
Implementation
DataRate get toGigabytesPerSecond => to(gigabytesPerSecond).gigabytesPerSecond;toKibibitsPerSecond no setter
DataRate get toKibibitsPerSecondConverts this to kibibits per second (Kibps) — 2¹⁰ bps.
Implementation
DataRate get toKibibitsPerSecond => to(kibibitsPerSecond).kibibitsPerSecond;toKibibytesPerSecond no setter
DataRate get toKibibytesPerSecondConverts this to kibibytes per second (KiB/s) — 2¹⁰ B/s.
Implementation
DataRate get toKibibytesPerSecond => to(kibibytesPerSecond).kibibytesPerSecond;toKilobitsPerSecond no setter
DataRate get toKilobitsPerSecondConverts this to kilobits per second (Kbps) — 10³ bps.
Implementation
DataRate get toKilobitsPerSecond => to(kilobitsPerSecond).kilobitsPerSecond;toKilobytesPerSecond no setter
DataRate get toKilobytesPerSecondConverts this to kilobytes per second (KB/s) — 10³ B/s.
Implementation
DataRate get toKilobytesPerSecond => to(kilobytesPerSecond).kilobytesPerSecond;toMebibitsPerSecond no setter
DataRate get toMebibitsPerSecondConverts this to mebibits per second (Mibps) — 2²⁰ bps.
Implementation
DataRate get toMebibitsPerSecond => to(mebibitsPerSecond).mebibitsPerSecond;toMebibytesPerSecond no setter
DataRate get toMebibytesPerSecondConverts this to mebibytes per second (MiB/s) — 2²⁰ B/s.
Implementation
DataRate get toMebibytesPerSecond => to(mebibytesPerSecond).mebibytesPerSecond;toMegabitsPerSecond no setter
DataRate get toMegabitsPerSecondConverts this to megabits per second (Mbps) — 10⁶ bps.
Implementation
DataRate get toMegabitsPerSecond => to(megabitsPerSecond).megabitsPerSecond;toMegabytesPerSecond no setter
DataRate get toMegabytesPerSecondConverts this to megabytes per second (MB/s) — 10⁶ B/s.
Implementation
DataRate get toMegabytesPerSecond => to(megabytesPerSecond).megabytesPerSecond;toPebibitsPerSecond no setter
DataRate get toPebibitsPerSecondConverts this to pebibits per second (Pibps) — 2⁵⁰ bps.
Implementation
DataRate get toPebibitsPerSecond => to(pebibitsPerSecond).pebibitsPerSecond;toPebibytesPerSecond no setter
DataRate get toPebibytesPerSecondConverts this to pebibytes per second (PiB/s) — 2⁵⁰ B/s.
Implementation
DataRate get toPebibytesPerSecond => to(pebibytesPerSecond).pebibytesPerSecond;toPetabitsPerSecond no setter
DataRate get toPetabitsPerSecondConverts this to petabits per second (Pbps) — 10¹⁵ bps.
Implementation
DataRate get toPetabitsPerSecond => to(petabitsPerSecond).petabitsPerSecond;toPetabytesPerSecond no setter
DataRate get toPetabytesPerSecondConverts this to petabytes per second (PB/s) — 10¹⁵ B/s.
Implementation
DataRate get toPetabytesPerSecond => to(petabytesPerSecond).petabytesPerSecond;toTebibitsPerSecond no setter
DataRate get toTebibitsPerSecondConverts this to tebibits per second (Tibps) — 2⁴⁰ bps.
Implementation
DataRate get toTebibitsPerSecond => to(tebibitsPerSecond).tebibitsPerSecond;toTebibytesPerSecond no setter
DataRate get toTebibytesPerSecondConverts this to tebibytes per second (TiB/s) — 2⁴⁰ B/s.
Implementation
DataRate get toTebibytesPerSecond => to(tebibytesPerSecond).tebibytesPerSecond;toTerabitsPerSecond no setter
DataRate get toTerabitsPerSecondConverts this to terabits per second (Tbps) — 10¹² bps.
Implementation
DataRate get toTerabitsPerSecond => to(terabitsPerSecond).terabitsPerSecond;toTerabytesPerSecond no setter
DataRate get toTerabytesPerSecondConverts this to terabytes per second (TB/s) — 10¹² B/s.
Implementation
DataRate get toTerabytesPerSecond => to(terabytesPerSecond).terabytesPerSecond;toYobibitsPerSecond no setter
DataRate get toYobibitsPerSecondConverts this to yobibits per second (Yibps) — 2⁸⁰ bps.
Implementation
DataRate get toYobibitsPerSecond => to(yobibitsPerSecond).yobibitsPerSecond;toYobibytesPerSecond no setter
DataRate get toYobibytesPerSecondConverts this to yobibytes per second (YiB/s) — 2⁸⁰ B/s.
Implementation
DataRate get toYobibytesPerSecond => to(yobibytesPerSecond).yobibytesPerSecond;toYottabitsPerSecond no setter
DataRate get toYottabitsPerSecondConverts this to yottabits per second (Ybps) — 10²⁴ bps.
Implementation
DataRate get toYottabitsPerSecond => to(yottabitsPerSecond).yottabitsPerSecond;toYottabytesPerSecond no setter
DataRate get toYottabytesPerSecondConverts this to yottabytes per second (YB/s) — 10²⁴ B/s.
Implementation
DataRate get toYottabytesPerSecond => to(yottabytesPerSecond).yottabytesPerSecond;toZebibitsPerSecond no setter
DataRate get toZebibitsPerSecondConverts this to zebibits per second (Zibps) — 2⁷⁰ bps.
Implementation
DataRate get toZebibitsPerSecond => to(zebibitsPerSecond).zebibitsPerSecond;toZebibytesPerSecond no setter
DataRate get toZebibytesPerSecondConverts this to zebibytes per second (ZiB/s) — 2⁷⁰ B/s.
Implementation
DataRate get toZebibytesPerSecond => to(zebibytesPerSecond).zebibytesPerSecond;toZettabitsPerSecond no setter
DataRate get toZettabitsPerSecondConverts this to zettabits per second (Zbps) — 10²¹ bps.
Implementation
DataRate get toZettabitsPerSecond => to(zettabitsPerSecond).zettabitsPerSecond;toZettabytesPerSecond no setter
DataRate get toZettabytesPerSecondConverts this to zettabytes per second (ZB/s) — 10²¹ B/s.
Implementation
DataRate get toZettabytesPerSecond => to(zettabytesPerSecond).zettabytesPerSecond;unit final inherited
final UnitOfMeasure<DataRate> unitThe unit of measure that value is expressed in.
Inherited from Quantity.
Implementation
final UnitOfMeasure<A> unit;value final inherited
final double valueThe 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
dynamic noSuchMethod(Invocation invocation)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
double to(UnitOfMeasure<DataRate> uom)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
String toString()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 +()
Returns the sum of this and that in the units of this DataRate.
Implementation
DataRate operator +(DataRate that) => DataRate(value + that.to(unit), unit);operator -()
Returns the difference between this and that in the units of this DataRate.
Implementation
DataRate operator -(DataRate that) => DataRate(value - that.to(unit), unit);operator <() inherited
bool operator <(DataRate that)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
bool operator <=(DataRate that)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
bool operator ==(Object other)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
bool operator >(DataRate that)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
bool operator >=(DataRate that)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
const BitsPerSecond bitsPerSecondUnit for bits per second (bps).
Implementation
static const bitsPerSecond = BitsPerSecond._();bytesPerSecond
const BytesPerSecond bytesPerSecondUnit for bytes per second (B/s) — the base unit of data rate.
Implementation
static const bytesPerSecond = BytesPerSecond._();exabitsPerSecond
const ExabitsPerSecond exabitsPerSecondUnit for exabits per second (Ebps) — 10¹⁸ bps.
Implementation
static const exabitsPerSecond = ExabitsPerSecond._();exabytesPerSecond
const ExabytesPerSecond exabytesPerSecondUnit for exabytes per second (EB/s) — 10¹⁸ B/s.
Implementation
static const exabytesPerSecond = ExabytesPerSecond._();exbibitsPerSecond
const ExbibitsPerSecond exbibitsPerSecondUnit for exbibits per second (Eibps) — 2⁶⁰ bps.
Implementation
static const exbibitsPerSecond = ExbibitsPerSecond._();exbibytesPerSecond
const ExbibytesPerSecond exbibytesPerSecondUnit for exbibytes per second (EiB/s) — 2⁶⁰ B/s.
Implementation
static const exbibytesPerSecond = ExbibytesPerSecond._();gibibitsPerSecond
const GibibitsPerSecond gibibitsPerSecondUnit for gibibits per second (Gibps) — 2³⁰ bps.
Implementation
static const gibibitsPerSecond = GibibitsPerSecond._();gibibytesPerSecond
const GibibytesPerSecond gibibytesPerSecondUnit for gibibytes per second (GiB/s) — 2³⁰ B/s.
Implementation
static const gibibytesPerSecond = GibibytesPerSecond._();gigabitsPerSecond
const GigabitsPerSecond gigabitsPerSecondUnit for gigabits per second (Gbps) — 10⁹ bps.
Implementation
static const gigabitsPerSecond = GigabitsPerSecond._();gigabytesPerSecond
const GigabytesPerSecond gigabytesPerSecondUnit for gigabytes per second (GB/s) — 10⁹ B/s.
Implementation
static const gigabytesPerSecond = GigabytesPerSecond._();kibibitsPerSecond
const KibibitsPerSecond kibibitsPerSecondUnit for kibibits per second (Kibps) — 2¹⁰ bps.
Implementation
static const kibibitsPerSecond = KibibitsPerSecond._();kibibytesPerSecond
const KibibytesPerSecond kibibytesPerSecondUnit for kibibytes per second (KiB/s) — 2¹⁰ B/s.
Implementation
static const kibibytesPerSecond = KibibytesPerSecond._();kilobitsPerSecond
const KilobitsPerSecond kilobitsPerSecondUnit for kilobits per second (Kbps) — 10³ bps.
Implementation
static const kilobitsPerSecond = KilobitsPerSecond._();kilobytesPerSecond
const KilobytesPerSecond kilobytesPerSecondUnit for kilobytes per second (KB/s) — 10³ B/s.
Implementation
static const kilobytesPerSecond = KilobytesPerSecond._();mebibitsPerSecond
const MebibitsPerSecond mebibitsPerSecondUnit for mebibits per second (Mibps) — 2²⁰ bps.
Implementation
static const mebibitsPerSecond = MebibitsPerSecond._();mebibytesPerSecond
const MebibytesPerSecond mebibytesPerSecondUnit for mebibytes per second (MiB/s) — 2²⁰ B/s.
Implementation
static const mebibytesPerSecond = MebibytesPerSecond._();megabitsPerSecond
const MegabitsPerSecond megabitsPerSecondUnit for megabits per second (Mbps) — 10⁶ bps.
Implementation
static const megabitsPerSecond = MegabitsPerSecond._();megabytesPerSecond
const MegabytesPerSecond megabytesPerSecondUnit for megabytes per second (MB/s) — 10⁶ B/s.
Implementation
static const megabytesPerSecond = MegabytesPerSecond._();pebibitsPerSecond
const PebibitsPerSecond pebibitsPerSecondUnit for pebibits per second (Pibps) — 2⁵⁰ bps.
Implementation
static const pebibitsPerSecond = PebibitsPerSecond._();pebibytesPerSecond
const PebibytesPerSecond pebibytesPerSecondUnit for pebibytes per second (PiB/s) — 2⁵⁰ B/s.
Implementation
static const pebibytesPerSecond = PebibytesPerSecond._();petabitsPerSecond
const PetabitsPerSecond petabitsPerSecondUnit for petabits per second (Pbps) — 10¹⁵ bps.
Implementation
static const petabitsPerSecond = PetabitsPerSecond._();petabytesPerSecond
const PetabytesPerSecond petabytesPerSecondUnit for petabytes per second (PB/s) — 10¹⁵ B/s.
Implementation
static const petabytesPerSecond = PetabytesPerSecond._();tebibitsPerSecond
const TebibitsPerSecond tebibitsPerSecondUnit for tebibits per second (Tibps) — 2⁴⁰ bps.
Implementation
static const tebibitsPerSecond = TebibitsPerSecond._();tebibytesPerSecond
const TebibytesPerSecond tebibytesPerSecondUnit for tebibytes per second (TiB/s) — 2⁴⁰ B/s.
Implementation
static const tebibytesPerSecond = TebibytesPerSecond._();terabitsPerSecond
const TerabitsPerSecond terabitsPerSecondUnit for terabits per second (Tbps) — 10¹² bps.
Implementation
static const terabitsPerSecond = TerabitsPerSecond._();terabytesPerSecond
const TerabytesPerSecond terabytesPerSecondUnit for terabytes per second (TB/s) — 10¹² B/s.
Implementation
static const terabytesPerSecond = TerabytesPerSecond._();units
const Set<DataRateUnit> unitsAll 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
const YobibitsPerSecond yobibitsPerSecondUnit for yobibits per second (Yibps) — 2⁸⁰ bps.
Implementation
static const yobibitsPerSecond = YobibitsPerSecond._();yobibytesPerSecond
const YobibytesPerSecond yobibytesPerSecondUnit for yobibytes per second (YiB/s) — 2⁸⁰ B/s.
Implementation
static const yobibytesPerSecond = YobibytesPerSecond._();yottabitsPerSecond
const YottabitsPerSecond yottabitsPerSecondUnit for yottabits per second (Ybps) — 10²⁴ bps.
Implementation
static const yottabitsPerSecond = YottabitsPerSecond._();yottabytesPerSecond
const YottabytesPerSecond yottabytesPerSecondUnit for yottabytes per second (YB/s) — 10²⁴ B/s.
Implementation
static const yottabytesPerSecond = YottabytesPerSecond._();zebibitsPerSecond
const ZebibitsPerSecond zebibitsPerSecondUnit for zebibits per second (Zibps) — 2⁷⁰ bps.
Implementation
static const zebibitsPerSecond = ZebibitsPerSecond._();zebibytesPerSecond
const ZebibytesPerSecond zebibytesPerSecondUnit for zebibytes per second (ZiB/s) — 2⁷⁰ B/s.
Implementation
static const zebibytesPerSecond = ZebibytesPerSecond._();zettabitsPerSecond
const ZettabitsPerSecond zettabitsPerSecondUnit for zettabits per second (Zbps) — 10²¹ bps.
Implementation
static const zettabitsPerSecond = ZettabitsPerSecond._();zettabytesPerSecond
const ZettabytesPerSecond zettabytesPerSecondUnit for zettabytes per second (ZB/s) — 10²¹ B/s.
Implementation
static const zettabytesPerSecond = ZettabytesPerSecond._();