DataType<T> class
abstract
Descriptor of a data type T
, how it is efficiently represented and stored
in memory, and strategy of how common operations work.
- Implementers
- Annotations
-
- @immutable
Constructors
- DataType()
-
Abstract const constructor.
const
Properties
- defaultValue → T
-
Returns the default value, typically equivalent to the zero or null value.
no setter
-
equality
→ Equality<
T> -
Returns an equality relation.
no setter
-
field
→ Field<
T> -
Returns a mathematical field, if available.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isNullable → bool
-
Returns true, if this DataType supports
null
values.no setter - name → String
-
Returns the name of this DataType.
no setter
-
nullable
→ DataType<
T?> -
Returns a DataType that supports
null
values.no setter -
printer
→ Printer<
T> -
Returns a default printer for this data type.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cast(
dynamic value) → T - Casts the argument to this data type, otherwise throw an ArgumentError.
-
castList(
Iterable< Object?> elements) → List<T> - Casts an existing list to this data type.
-
comparator(
T a, T b) → int - Returns a Comparator that compares one element to another.
-
copyList(
Iterable< T> list, {int? length, T? fillValue}) → List<T> -
Creates a fixed-length list copy of this data type, possibly with a
modified
length
and if necessary populated withfillValue
. -
newList(
int length, [T? fillValue]) → List< T> - Creates a fixed-length list of this data type.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- float ↔ FloatDataType
-
Configurable default data type for floating point arithmetic.
getter/setter pair
- indexDataType ↔ IntegerDataType
-
Configurable default data type to index collections, rows, columns, etc.
getter/setter pair
- intDataType ↔ IntegerDataType
-
Configurable default data type for integer arithmetic.
getter/setter pair
Static Methods
-
fromInstance<
T> (T instance) → DataType< T> -
Derives a fitting DataType from
instance
. -
fromIterable<
T> (Iterable< T> iterable) → DataType<T> -
Derives a fitting DataType from an
iterable
. -
fromType<
T> () → DataType< T> -
Derives a fitting DataType from
T
. -
modulo<
T> (DataType< T> delegate, T modulus) → ModuloDataType<T> - Return an modulo data type.
-
nullableObject<
T> ([T? defaultValue]) → ObjectDataType< T?> -
Return a nullable object type
T
with the optionaldefaultValue
. -
object<
T> (T defaultValue) → ObjectDataType< T> -
Return an object type
T
with the givendefaultValue
.
Constants
- bigInt → const BigIntDataType
- BigInt object data type.
- boolean → const BooleanDataType
- bool object data type.
- complex → const ComplexDataType
- Complex object data type.
- dynamicType → const DynamicDataType
-
Dynamic object type that can hold any Object or
null
. - float32 → const FloatDataType
- 32-bit double data type.
- float64 → const FloatDataType
- 64-bit double data type.
- fraction → const FractionDataType
- Fraction object data type.
- int8 → const IntegerDataType
- Signed 8-bit int data type.
- int16 → const IntegerDataType
- Signed 16-bit int data type.
- int32 → const IntegerDataType
- Signed 32-bit int data type.
- int64 → const IntegerDataType
- Signed 64-bit int data type.
- numeric → const NumericDataType
- num object data type.
- quaternion → const QuaternionDataType
- Quaternion object data type.
- string → const StringDataType
- String object data type.
- uint8 → const IntegerDataType
- Unsigned 8-bit int data type.
- uint16 → const IntegerDataType
- Unsigned 16-bit int data type.
- uint32 → const IntegerDataType
- Unsigned 32-bit int data type.
- uint64 → const IntegerDataType
- Unsigned 64-bit int data type.