Collection Object that maintains order of entry? 
Author Message
 Collection Object that maintains order of entry?

I need a collection that gives me access to Key functions (Keys enumerator
and ContainsKey()) and maintains the order in which items were added.
The Hashtable does not maintain order when enumerating keys.
And the SortedList, sorts, which is not what I need either.
The basic Collection does not allow access to key functions.

I need a Keys enumerator and a ContainsKey() method.

Thanks.



Thu, 11 Nov 2004 12:08:05 GMT  
 Collection Object that maintains order of entry?
Isn't that an unexpected behavior? I ended up making my own class to do it.
It needed to implement the Ienumerable interface.

The class is a dictionary. if you are interested I will send you the class.
It does has a keyExists method and a Keys list...

Quote:
> I need a collection that gives me access to Key functions (Keys enumerator
> and ContainsKey()) and maintains the order in which items were added.
> The Hashtable does not maintain order when enumerating keys.
> And the SortedList, sorts, which is not what I need either.
> The basic Collection does not allow access to key functions.

> I need a Keys enumerator and a ContainsKey() method.

> Thanks.



Sun, 14 Nov 2004 21:51:41 GMT  
 Collection Object that maintains order of entry?
I found the System.Collections.Specialized.ListDictionary which does
maintain order of entry.
It's not as efficient because it's based on a simple linked list, but since
I'm not dealing with very many
items in my list, then I decided to go with it.

Thanks for the reply.


Quote:
> Isn't that an unexpected behavior? I ended up making my own class to do
it.
> It needed to implement the Ienumerable interface.

> The class is a dictionary. if you are interested I will send you the
class.
> It does has a keyExists method and a Keys list...


> > I need a collection that gives me access to Key functions (Keys
enumerator
> > and ContainsKey()) and maintains the order in which items were added.
> > The Hashtable does not maintain order when enumerating keys.
> > And the SortedList, sorts, which is not what I need either.
> > The basic Collection does not allow access to key functions.

> > I need a Keys enumerator and a ContainsKey() method.

> > Thanks.



Sun, 14 Nov 2004 22:08:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need Object Model advise for Order Entry App

2. Order of objects in collection form

3. Maintaining variable data and objects in a MTS object

4. dictionary objects: key in order = sequential out order?

5. Order of entry

6. Tab order in online data-entry form?

7. sample order entry application

8. sample order entry application

9. Example order entry VB application

10. Order Number Entry??

11. Order Entry -VB4 & Access code needed

12. Order Entry System Needed

 

 
Powered by phpBB® Forum Software