I don\'t know if this is possible but i\'m trying to make an Hashtable of where Interval is a class with 2 integer / long values, a start and an end and i wanted to make so
No need to reinvent the wheel, use a NavigableMap. Example Code:
final NavigableMap map = new TreeMap();
map.put(0, "Cry Baby");
map.put(6, "School Time");
map.put(16, "Got a car yet?");
map.put(21, "Tequila anyone?");
map.put(45, "Time to buy a corvette");
System.out.println(map.floorEntry(3).getValue());
System.out.println(map.floorEntry(10).getValue());
System.out.println(map.floorEntry(18).getValue());
Output:
Cry Baby
School Time
Got a car yet?