>> Actually, java.util.Arrays.binarySearch does return the insertion point.
>
> my goodness...I wish I knew this existed before.

Signature
The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
> >> Actually, java.util.Arrays.binarySearch does return the insertion point.
> >
[quoted text clipped - 9 lines]
> http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
> ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
my bad. i usually do google up functions, but for some reason i didn't
think to check for something like that.
but i must say.. java sun's documentation really sucks.
if you look up compareTo for strings, it doesnt even tell you what
-1,0, and 1 actually mean...even if it is somewhat intuitivly obvious.
that and they don't provide any examples...
now compare that with php.net's stuff..100x better. and anything that
*isnt* in the documentation is usually posted by some nice feller just
below.
but that's my little rant.
John W. Kennedy - 29 Sep 2006 03:52 GMT
> but i must say.. java sun's documentation really sucks.
> if you look up compareTo for strings, it doesnt even tell you what
> -1,0, and 1 actually mean...even if it is somewhat intuitivly obvious.
¿Que?
"The result is a negative integer if this String object
lexicographically precedes the argument string. The result is a positive
integer if this String object lexicographically follows the argument
string. The result is zero if the strings are equal; compareTo returns 0
exactly when the equals(Object) method would return true.
"This is the definition of lexicographic ordering. If two strings are
different, then either they have different characters at some index that
is a valid index for both strings, or their lengths are different, or
both. If they have different characters at one or more index positions,
let k be the smallest such index; then the string whose character at
position k has the smaller value, as determined by using the < operator,
lexicographically precedes the other string. In this case, compareTo
returns the difference of the two character values at position k in the
two string -- that is, the value:
this.charAt(k)-anotherString.charAt(k) "

Signature
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
Mark - 05 Oct 2006 22:29 GMT
> > but i must say.. java sun's documentation really sucks.
> > if you look up compareTo for strings, it doesnt even tell you what
[quoted text clipped - 25 lines]
> Nourished the land on a fallacy of rational virtue."
> -- Charles Williams. "Taliessin through Logres: Prelude"
>.<
I don't know what i was looking at when I wrote that.
I don't think I've been getting enough sleep.
Thomas Weidenfeller - 29 Sep 2006 08:05 GMT
>> That's why we try so hard to convince people to read and search the
>> documentation. Its not there for pure decorative purposes. One can gain
[quoted text clipped - 3 lines]
> -1,0, and 1 actually mean...even if it is somewhat intuitivly obvious.
> that and they don't provide any examples...
Bzzzz. Game Over on Player One - You lost.
You are just demonstrating that you haven't read the documentation. It
is explained in detail right in the String.compareTo() method's API
documentation.
> now compare that with php.net's stuff..100x better.
Sure, if you like your daily does of yet another PHP vulnerably use PHP.
/Thomas

Signature
The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
Mark - 05 Oct 2006 22:32 GMT
> Sure, if you like your daily does of yet another PHP vulnerably use PHP.
>
> /Thomas
Vulnerability? I'll cry when I get hacked, but at the moment my site is
too small for anyone to care enough to try. It serves my purposes, I'm
content.
I'm not even going to say you're wrong, because really I have no idea,
I'll admit that.