basically have an array and search it. And like the excel Match function, if the value is not found in the array it will return the index of the next closest value? This is something thats easy to code, but i was just tryin to see if there was a built in java method that would do something like this for me.
Not that I'm aware of. Well, not for arrays. SortedSet NavigableSet (with implementing class TreeSet) does have something like this, with the head and tail sets.
NavigableSet is a bit better than SortedSet because it allows the bound for the head / tail sets to be inclusive or not; with SortedSet you cannot specify this yourself.
awesome man thanks that almost worked lol. i using strings of time and the set doesn't know the difference between AM and PM when comparing strings
always returns 11:30 PM. so ill have to do some data manipulation i guess and convert to military time or something before i insert the data into the set. but either way its a step in the right direction and better than writing my own function!
The strings in your set will be sorted alphabetically so if you want to take into account the AM / PM you would need to use something other than String or have a class that implements comparable and overides compareTo() to take it into account i think.