• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RangeMap implementation

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm looking for a RangeMap implementation where an integer value (24 as an example) that falls within a range (1 - 100) of values will retrieve an object (Object1).

RangeMap map = new RangeMap();
map.put(minVal, maxVal, obj);

Has anyone used a stable lib that accomplishes this type of logic ?

Thanks in advance
Chris
 
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know the answer to your question, but I'm curious what type of problem you'd solve with this data structure?
 
Chris Brat
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on a thin-client application where we are displaying a network of circuits which can have multiple levels, branches and splits (which rejoin further on in the circuit).

The configuration of the circuit is determined at real time since we get data loads from external systems which may or may not be connected to each other and/or to elements in the existing circuit.

I specifically want this type of range map to be able to check for an existing image at a specific co-ordinate, on the screen to prevent connections between elements from being drawn over existing images on the screen.

As an example : a simple square is drawn at x1 = 350, y1 = 50, x2 = 400, y2 = 100 and a connection must be drawn between two points xa = 200, ya= 75 and xb = 450, yb = 75 ( this would draw through the square unless I can check in the map if an element exists between the two points).

After I made the post I saw that the sorted map can possibly be used as a solution.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic