Sponsored Links

Minggu, 14 Januari 2018

Sponsored Links

container - Wiktionary
src: upload.wikimedia.org

In computer science, a container is a class, a data structure, or an abstract data type (ADT) whose instances are collections of other objects. In other words, they store objects in an organized way that follows specific access rules. The size of the container depends on the number of objects (elements) it contains. Underlying (inherited) implementations of various container types may vary in size and complexity, and provide flexibility in choosing the right implementation for any given scenario.


Video Container (abstract data type)



Function and properties

Containers can be characterized by the following three properties:

  • access, that is the way of accessing the objects of the container. In the case of arrays, access is done with the array index. In the case of stacks, access is done according to the LIFO (last in, first out) order and in the case of queues it is done according to the FIFO (first in, first out) order;
  • storage, that is the way of storing the objects of the container;
  • traversal, that is the way of traversing the objects of the container.

Container classes are expected to implement methods to do the following:

  • create an empty container (constructor);
  • insert objects into the container;
  • delete objects from the container;
  • delete all the objects in the container (clear);
  • access the objects in the container;
  • access the number of objects in the container (count).

Containers are sometimes implemented in conjunction with iterators.


Maps Container (abstract data type)



Types

Containers may be classified as either single-value containers or associative containers.

Single-value containers store each object independently. Objects may be accessed directly or with an iterator.

An associative container uses an associative array, map, or dictionary, composed of key-value pairs, such that each key appears at most once in the container. The key is used to find the value, the object, if it is stored in the container. Associative containers are used in programming languages as class templates.


Abap Development Tools: First little coding steps! | SAP Blogs
src: blogs.sap.com


Graphic containers

Widget toolkits also use containers, which are special widgets to group other widgets, such as windows, panels. Apart from their graphical properties, they have the same type of behavior as container classes, as they keep a list of their child widgets, and allow adding, removing, or retrieving widgets among their children.


Inheritance, Abstraction, Encapsulation, Polymorphism - ppt download
src: slideplayer.com


Implementations

  • .NET: System.Collections (MSDN)
  • ActionScript3: AS3Commons Collections Framework
  • C++: C++ Standard Library (SC++L) or the obsolete Standard Template Library (STL)
    • Containers are divided in the Standard Template Library into associative containers and standard sequence containers. Besides these two types, so-called container adaptors exist. Data structures that are implemented by containers include arrays, lists, maps, queues, sets, stacks, tables, trees, and vectors.
  • Java: Java collections framework (JCF)
  • Objective-C: part of the Foundation Kit
  • PL/SQL Collections
  • Python: has built in containers list, dict, tuple and set and can be further extended by the collections module
  • Scala Mutable and Immutable Collections in the packages scala.collection.mutable and scala.collection.immutable

terminology - What is ADT? (Abstract Data Type) - Stack Overflow
src: i.stack.imgur.com


See also

  • List of data structures
  • Standard Template Library#Containers
  • Collection (abstract data type)
  • Stack data structure
  • Java ConcurrentMap

Shipping container architecture - Wikipedia
src: upload.wikimedia.org


References


Support: ArrayLists and Generics - University of California, San ...
src: d3c33hcgiwev3.cloudfront.net


External links

  • Container Data Structure Declaration and Initialization
  • Container data structures
  • Python SortedContainers module A fast implementation of sorted list, sorted dict, and sorted set data types in Python.

Source of the article : Wikipedia

Comments
0 Comments