Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Yes, that's one way, although my app rely on the keys for other things. Perhaps it needs to be split, leaving more serializing work to be done, but maybe there is no better way? Hmm. Commented May 9, 2011 at 4:02
  • @Alexander: if a built-in data structure doesn't meet your needs, your best bet is to implement your own. With an event queue class, you can implement the Iterator and ArrayAccess interfaces. It will function as an array, but will give you greater control over positioning. You can even add methods to get and set the position (possibly using overloading).
    – outis
    Commented May 10, 2011 at 8:04
  • yes, of course, and I'm starting to lean that way. First I'll see how expensive the insert/seek operation on an array is, and if proven bad I'll do exactly that. :) It just seemed like a hashmap with internal pointer would have at least a way to set the pointer by key, but I may have to go all OO on 'im to make it snappy enough. Commented May 10, 2011 at 20:55