1 |
/* Comparator.java -- Interface for objects that specify an ordering |
/* Comparator.java -- Interface for objects that specify an ordering |
2 |
Copyright (C) 1998, 2001 Free Software Foundation, Inc. |
Copyright (C) 1998, 2001, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
71 |
* @since 1.2 |
* @since 1.2 |
72 |
* @status updated to 1.4 |
* @status updated to 1.4 |
73 |
*/ |
*/ |
74 |
public interface Comparator |
public interface Comparator<T> |
75 |
{ |
{ |
76 |
/** |
/** |
77 |
* Return an integer that is negative, zero or positive depending on whether |
* Return an integer that is negative, zero or positive depending on whether |
102 |
* @throws ClassCastException if the elements are not of types that can be |
* @throws ClassCastException if the elements are not of types that can be |
103 |
* compared by this ordering. |
* compared by this ordering. |
104 |
*/ |
*/ |
105 |
int compare(Object o1, Object o2); |
int compare(T o1, T o2); |
106 |
|
|
107 |
/** |
/** |
108 |
* Return true if the object is equal to this object. To be |
* Return true if the object is equal to this object. To be |