OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Reference for types of collections


Here is the reference mentioned today in our discussion on types of collections.

https://www.omg.org/spec/OCL/2.4/PDF.  See sections 11.6 and following.

 

My summary of the definitions from the OCL reference.

OCL

Description

collection

an aggregation of elements. If an element occurs twice in a collection, there are two elements.

set

contains elements without duplicates.

orderedset

a set, the elements of which are ordered. It contains no duplicates.

bag

a collection with duplicates allowed.

sequence

a collection where the elements are ordered.

 

My comparison between C++ and OCL terms.

C++

~OCL

C++ Description

container

collection

An object that stores other objects.

unordered_map

unordered_set

set

an unordered associative container that supports unique keys (an unordered_set contains at most one of each key value) and in which the elements’ keys are the elements themselves.

map

set

orderedset

an ordered associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval of the keys themselves.

unordered_multimap

unordered_multiset

bag

an unordered associative container that supports equivalent keys (an instance of unordered_multiset may contain multiple copies of the same key value) and in which each element’s key is the element itself.

multimap

multiset

sequence

an ordered associative container that supports equivalent keys (possibly contains multiple copies of the same key value) and provides for fast retrieval of the keys themselves.

 

Thanks,

George

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]