[size=13][SNIP][/size]
I need to build a specialization hierarchy of Collection classes, possibly based upon some combination their functionality and type. Then I can abstract out common features to a generalized Collection class. I'm exploring the idea that associative collections are a specialization of Sequential (non-associative) collections.[size=13][SNIP][/size]
I'm having difficulty, looking at the list of Collection types from various sources, getting a good handle on the types of Collections. In particular, which might apply to the CIM and which are more suited to the PIM and PSM or even the code itself.
Perhaps we might gainfully start by defining some named types and their functionality in a coding language neutral way? We should resist terms like:
Constant time random access is not supported or
Insertion and removal in the middle take linear time.
I'll kick off with a few...
Vector: (Non-Associative) Can be traversed in one direction only, Can add and remove from anywhere
List: (Non-Associative) Can be traversed in both directions, Can add and remove from anywhere
Deque: (Non-Associative) Can add and remove from either end only
Queue: (Non-Associative) Can add at start only and remove from end only
Stack: (Non-Associative) Can add at and remove from start only
Questions:
Traversal of Deque, Queue and Stack?
It would seem that Stack and Queue are specializations of Deque?
I've seen a definition of Deque that allows addition/removal in the middle (if so, how different from List)?
Is Uni- versus Bi-Directional traversal merely a policy to be applied?
Perhaps
all we have is a matrix of policies and
names to be given to
specific combinations of policies?
Paolo