GlobNodeCollection<T extends GlobNode> constructor
GlobNodeCollection<T extends GlobNode>(
- String? source,
- int? position,
- List<T>? nodes
)
Implementation
GlobNodeCollection(String? source, int? position, List<T>? nodes)
: super(source, position) {
if (nodes == null) {
throw ArgumentError.notNull('nodes');
}
if (nodes.isEmpty) {
throw ArgumentError('List of nodes may not be empty');
}
for (final node in nodes) {
if (node is! T) {
throw ArgumentError('List of nodes contains invalid elements.');
}
}
_nodes = nodes.toList();
}