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 iterable to this data type.
comparator(T a, T b) int
Returns a Comparator that compares one element to another.
copyList(Iterable<T> iterable, {int? length, T? fillValue, bool readonly = false}) List<T>
Creates a fixed-length list copy of the iterable, possibly with a modified length and if necessary populated with fillValue.
newList(int length, {Map1<int, T>? generate, T? fillValue, bool readonly = false}) 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<List<double>>
Configurable default data type for floating point arithmetic.
getter/setter pair
index IntegerDataType<List<int>>
Configurable default data type to index collections, rows, columns, etc.
getter/setter pair
integer IntegerDataType<List<int>>
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 optional defaultValue.
object<T>(T defaultValue) ObjectDataType<T>
Return an object type T with the given defaultValue.

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<List<double>>
32-bit double data type.
float64 → const FloatDataType<List<double>>
64-bit double data type.
fraction → const FractionDataType
Fraction object data type.
int8 → const IntegerDataType<List<int>>
Signed 8-bit int data type.
int16 → const IntegerDataType<List<int>>
Signed 16-bit int data type.
int32 → const IntegerDataType<List<int>>
Signed 32-bit int data type.
int64 → const IntegerDataType<List<int>>
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<List<int>>
Unsigned 8-bit int data type.
uint16 → const IntegerDataType<List<int>>
Unsigned 16-bit int data type.
uint32 → const IntegerDataType<List<int>>
Unsigned 32-bit int data type.
uint64 → const IntegerDataType<List<int>>
Unsigned 64-bit int data type.