Less than 42 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RangeMap implementation  RSS feed

 
Chris Brat
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • 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
 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!