(Collection|Container) Data Type (Set, Bag, Sequence)

About

A collection is a abstract data type for grouping together multiple values.

It's therefore sometime known as a container and creates a aggregation relationship

A collection is:

  • an object that groups multiple elements into a single unit.
  • just a grouping of some objects with the same type.

Once the data has been put in a collection, the data has been aggregated and we get aggregate data

Collections are used to store, retrieve, manipulate, and communicate aggregate data.

The inverse of a collection (ie a single element) is called a scalar.

Management

Type

Primary

An array is a collection structure that is used to implement [#abstract|abstract collection]].

Abstract

The Primary abstract data type are base on this two properties:

  • ordering mater: Ie (A,B) is not the same than (B,A)
  • unique: allow or not duplicate

Collection that can be seen as a set

Ordering matter Allow duplicate Collection Abstract Type
Set of elements
false false Set
false true Bag (multiset)
true true Sequence (list)
true false OrderedSet
Set of Key/Pair elements (Properties are for the key)
false false Map
false true wiki/Multimap

Mixed / Derived

  • A tree is a collection of a collection. Most of the collections are implemented via a tree structure to permit fast access
  • A queue or stack is a sequence where the extraction of elements is determined by the notion of first or last
  • A graph is a set of nodes and a set of edges.
  • A string is a sequence of character

Operations

Standard Operations on collection are defined in functional programming

Language Package

Documentation / Reference

Task Runner