in reply to Re: Hash keyed on ranges
in thread Hash keyed on ranges
How would the extent each of the ranges be established?
They come from the source fragments of the composite string. Say the composite string is made up of three fragments "FOO" "QUUX" and "BAR". Each of these fragments is a string-based object, with extra info attached to it that I need to access. My ranged hash (or maybe array - thanks dragonchild) would then look like:
# ... stands for the fragment's metadata { 0 => Fragment->new('FOO', ...), 3 => Fragment->new('QUUX', ...), 7 => Fragment->new('BAR', ...) } # and the composite string looks like "FOOQUUXBAR";
I want to be able to get back to the source fragment object (and its associated data) quickly from a given offset in the composite string.
Do the ranges overlap?
Nope
Are the ranges contiguous?
Yup
Can you reasonably guestimate the minimum and maximium integer values?
Not easily, no - the fragments might be quite short or several thousand characters long, and the total number of fragments is also very variable.
Thanks/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Hash keyed on ranges
by BrowserUk (Patriarch) on May 07, 2004 at 14:06 UTC |