Alexei Zakharov 写道:
> Hi Spark,
>
>> When both are null, -1 will be returned. This mocked comparator is used
>> as a boundary test condition, and under this condition,
>> if there is null entry contained in tree map, is will not be included in
>> the SortedMap returned by headMap(null) method.
>
>
Hi Spark,
When both are null, -1 will be returned. This mocked comparator is used
as a boundary test condition, and under this condition,
if there is null entry contained in tree map, is will not be included in
the SortedMap returned by headMap(null) method.
IMHO you need to be carefull here s
Stepan Mishura 写道:
> On 8/2/06, Spark Shen wrote:
>>
>> Richard Liang 写道:
>> >
>> >
>> > Spark Shen wrote:
>> >> I constructed a MockComparator as below:
>> >> public static class MockComparator implements Comparator {
>> >> public int compare(T o1, T o2) {
>> >> if(null == o1) return -1;
>> >> if(
On 8/2/06, Spark Shen wrote:
Richard Liang 写道:
>
>
> Spark Shen wrote:
>> I constructed a MockComparator as below:
>> public static class MockComparator implements Comparator {
>> public int compare(T o1, T o2) {
>> if(null == o1) return -1;
>> if(o1.equals(o2)) {
>> return 0;
>> }
>> return 1;
Richard Liang 写道:
Spark Shen wrote:
I constructed a MockComparator as below:
public static class MockComparator implements Comparator {
public int compare(T o1, T o2) {
if(null == o1) return -1;
if(o1.equals(o2)) {
return 0;
}
return 1;
}
}
This comparator regards null as the smallest object
Spark Shen wrote:
I constructed a MockComparator as below:
public static class MockComparator implements Comparator {
public int compare(T o1, T o2) {
if(null == o1) return -1;
if(o1.equals(o2)) {
return 0;
}
return 1;
}
}
I constructed a MockComparator as below:
public static class MockComparator implements Comparator {
public int compare(T o1, T o2) {
if(null == o1) return -1;
if(o1.equals(o2)) {
return 0;
}
return 1;
}
}
This comparator reg