Information class final
A quantity representing digital information — measured in bytes or bits, with both metric (SI) and binary (IEC) prefix variants.
Metric prefixes (kilo, mega, giga, …) use powers of 10 (10³, 10⁶, 10⁹, …). Binary prefixes (kibi, mebi, gibi, …) use powers of 2 (2¹⁰, 2²⁰, 2³⁰, …).
The internal base unit is bytes (B). Bit-based units use a conversion factor of BitsConversionFactor (0.125 = 1/8).
- Inheritance
-
- Object
- Quantity<
Information> - Information
Constructors
-
Information(double value, UnitOfMeasure<
Information> unit)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toBits → Information
-
Converts this to bits (bit).
no setter
- toBytes → Information
-
Converts this to bytes (B).
no setter
- toExabits → Information
-
Converts this to exabits (Ebit) — 10¹⁸ bits.
no setter
- toExabytes → Information
-
Converts this to exabytes (EB) — 10¹⁸ bytes.
no setter
- toExbibits → Information
-
Converts this to exbibits (Eibit) — 2⁶⁰ bits.
no setter
- toExbibytes → Information
-
Converts this to exbibytes (EiB) — 2⁶⁰ bytes.
no setter
- toGibibits → Information
-
Converts this to gibibits (Gibit) — 2³⁰ bits.
no setter
- toGibibytes → Information
-
Converts this to gibibytes (GiB) — 2³⁰ bytes.
no setter
- toGigabits → Information
-
Converts this to gigabits (Gbit) — 10⁹ bits.
no setter
- toGigabytes → Information
-
Converts this to gigabytes (GB) — 10⁹ bytes.
no setter
- toKibibits → Information
-
Converts this to kibibits (Kibit) — 2¹⁰ bits.
no setter
- toKibibytes → Information
-
Converts this to kibibytes (KiB) — 2¹⁰ bytes.
no setter
- toKilobits → Information
-
Converts this to kilobits (Kbit) — 10³ bits.
no setter
- toKilobytes → Information
-
Converts this to kilobytes (KB) — 10³ bytes.
no setter
- toMebibits → Information
-
Converts this to mebibits (Mibit) — 2²⁰ bits.
no setter
- toMebibytes → Information
-
Converts this to mebibytes (MiB) — 2²⁰ bytes.
no setter
- toMegabits → Information
-
Converts this to megabits (Mbit) — 10⁶ bits.
no setter
- toMegabytes → Information
-
Converts this to megabytes (MB) — 10⁶ bytes.
no setter
- toOctets → Information
-
Converts this to octets (o) — equivalent to bytes.
no setter
- toPebibits → Information
-
Converts this to pebibits (Pibit) — 2⁵⁰ bits.
no setter
- toPebibytes → Information
-
Converts this to pebibytes (PiB) — 2⁵⁰ bytes.
no setter
- toPetabits → Information
-
Converts this to petabits (Pbit) — 10¹⁵ bits.
no setter
- toPetabytes → Information
-
Converts this to petabytes (PB) — 10¹⁵ bytes.
no setter
- toTebibits → Information
-
Converts this to tebibits (Tibit) — 2⁴⁰ bits.
no setter
- toTebibytes → Information
-
Converts this to tebibytes (TiB) — 2⁴⁰ bytes.
no setter
- toTerabits → Information
-
Converts this to terabits (Tbit) — 10¹² bits.
no setter
- toTerabytes → Information
-
Converts this to terabytes (TB) — 10¹² bytes.
no setter
- toYobibits → Information
-
Converts this to yobibits (Yibit) — 2⁸⁰ bits.
no setter
- toYobibytes → Information
-
Converts this to yobibytes (YiB) — 2⁸⁰ bytes.
no setter
- toYottabits → Information
-
Converts this to yottabits (Ybit) — 10²⁴ bits.
no setter
- toYottabytes → Information
-
Converts this to yottabytes (YB) — 10²⁴ bytes.
no setter
- toZebibits → Information
-
Converts this to zebibits (Zibit) — 2⁷⁰ bits.
no setter
- toZebibytes → Information
-
Converts this to zebibytes (ZiB) — 2⁷⁰ bytes.
no setter
- toZettabits → Information
-
Converts this to zettabits (Zbit) — 10²¹ bits.
no setter
- toZettabytes → Information
-
Converts this to zettabytes (ZB) — 10²¹ bytes.
no setter
-
unit
→ UnitOfMeasure<
Information> -
The unit of measure that value is expressed in.
finalinherited
- value → double
-
The raw numeric value of this quantity expressed in unit.
finalinherited
Methods
-
equivalentTo(
Quantity< Information> other) → bool -
Returns true if this quantity represents the same physical magnitude as
other, regardless of which unit each is expressed in.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
to(
UnitOfMeasure< Information> uom) → double -
Converts this quantity to
uomand returns the raw double value.inherited -
toCoarsest(
) → Information - Returns this value expressed in the coarsest (most human-readable) unit within the same prefix family as the current unit.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator +(
Information that) → Information -
Returns the sum of this quantity and
that, expressed in unit.inherited -
operator -(
Information that) → Information -
Returns the difference of this quantity and
that, expressed in unit.inherited -
operator <(
Information that) → bool -
Returns true if this quantity is less than
that.inherited -
operator <=(
Information that) → bool -
Returns true if this quantity is less than or equal to
that.inherited -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
Information that) → bool -
Returns true if this quantity is greater than
that.inherited -
operator >=(
Information that) → bool -
Returns true if this quantity is greater than or equal to
that.inherited
Static Properties
-
units
→ Set<
InformationUnit> -
All supported Information units.
final
Static Methods
-
parse(
String s) → Option< Information> -
Parses
sinto an Information, returningNoneif parsing fails.override
Constants
- bits → const Bits
- Unit for bits (bit) — 1/8 of a byte.
- BitsConversionFactor → const double
- Conversion factor from bytes to bits: 1 byte = 8 bits, so 1 bit = 0.125 bytes.
- bytes → const Bytes
- Unit for bytes (B) — the SI base unit of information.
- exabits → const Exabits
- Unit for exabits (Ebit) — 10¹⁸ bits.
- exabytes → const Exabytes
- Unit for exabytes (EB) — 10¹⁸ bytes.
- exbibits → const Exbibits
- Unit for exbibits (Eibit) — 2⁶⁰ bits.
- exbibytes → const Exbibytes
- Unit for exbibytes (EiB) — 2⁶⁰ bytes.
- gibibits → const Gibibits
- Unit for gibibits (Gibit) — 2³⁰ bits.
- gibibytes → const Gibibytes
- Unit for gibibytes (GiB) — 2³⁰ bytes.
- gigabits → const Gigabits
- Unit for gigabits (Gbit) — 10⁹ bits.
- gigabytes → const Gigabytes
- Unit for gigabytes (GB) — 10⁹ bytes.
- kibibits → const Kibibits
- Unit for kibibits (Kibit) — 2¹⁰ bits.
- kibibytes → const Kibibytes
- Unit for kibibytes (KiB) — 2¹⁰ = 1 024 bytes.
- kilobits → const Kilobits
- Unit for kilobits (Kbit) — 10³ bits.
- kilobytes → const Kilobytes
- Unit for kilobytes (KB) — 10³ bytes.
- mebibits → const Mebibits
- Unit for mebibits (Mibit) — 2²⁰ bits.
- mebibytes → const Mebibytes
- Unit for mebibytes (MiB) — 2²⁰ = 1 048 576 bytes.
- megabits → const Megabits
- Unit for megabits (Mbit) — 10⁶ bits.
- megabytes → const Megabytes
- Unit for megabytes (MB) — 10⁶ bytes.
- octets → const Octets
- Unit for octets (o) — equivalent to bytes; common in networking contexts.
- pebibits → const Pebibits
- Unit for pebibits (Pibit) — 2⁵⁰ bits.
- pebibytes → const Pebibytes
- Unit for pebibytes (PiB) — 2⁵⁰ bytes.
- petabits → const Petabits
- Unit for petabits (Pbit) — 10¹⁵ bits.
- petabytes → const Petabytes
- Unit for petabytes (PB) — 10¹⁵ bytes.
- tebibits → const Tebibits
- Unit for tebibits (Tibit) — 2⁴⁰ bits.
- tebibytes → const Tebibytes
- Unit for tebibytes (TiB) — 2⁴⁰ bytes.
- terabits → const Terabits
- Unit for terabits (Tbit) — 10¹² bits.
- terabytes → const Terabytes
- Unit for terabytes (TB) — 10¹² bytes.
- yobibits → const Yobibits
- Unit for yobibits (Yibit) — 2⁸⁰ bits.
- yobibytes → const Yobibytes
- Unit for yobibytes (YiB) — 2⁸⁰ bytes.
- yottabits → const Yottabits
- Unit for yottabits (Ybit) — 10²⁴ bits.
- yottabytes → const Yottabytes
- Unit for yottabytes (YB) — 10²⁴ bytes.
- zebibits → const Zebibits
- Unit for zebibits (Zibit) — 2⁷⁰ bits.
- zebibytes → const Zebibytes
- Unit for zebibytes (ZiB) — 2⁷⁰ bytes.
- zettabits → const Zettabits
- Unit for zettabits (Zbit) — 10²¹ bits.
- zettabytes → const Zettabytes
- Unit for zettabytes (ZB) — 10²¹ bytes.