156 |
* @since 1.4 |
* @since 1.4 |
157 |
*/ |
*/ |
158 |
public final class URI |
public final class URI |
159 |
implements Comparable, Serializable |
implements Comparable<URI>, Serializable |
160 |
{ |
{ |
161 |
/** |
/** |
162 |
* For serialization compatability. |
* For serialization compatability. |
1224 |
} |
} |
1225 |
|
|
1226 |
/** |
/** |
1227 |
* Compare the URI with another object that must also be a URI. |
* Compare the URI with another URI. |
1228 |
* Undefined components are taken to be less than any other component. |
* Undefined components are taken to be less than any other component. |
1229 |
* The following criteria are observed: |
* The following criteria are observed: |
1230 |
* </p> |
* </p> |
1260 |
* </ul> |
* </ul> |
1261 |
* </ul> |
* </ul> |
1262 |
* |
* |
1263 |
* @param obj This object to compare this URI with |
* @param uri The other URI to compare this URI with |
1264 |
* @return a negative integer, zero or a positive integer depending |
* @return a negative integer, zero or a positive integer depending |
1265 |
* on whether this URI is less than, equal to or greater |
* on whether this URI is less than, equal to or greater |
1266 |
* than that supplied, respectively. |
* than that supplied, respectively. |
|
* @throws ClassCastException if the given object is not a URI |
|
1267 |
*/ |
*/ |
1268 |
public int compareTo(Object obj) |
public int compareTo(URI uri) |
1269 |
throws ClassCastException |
throws ClassCastException |
1270 |
{ |
{ |
|
URI uri = (URI) obj; |
|
1271 |
if (scheme == null && uri.getScheme() != null) |
if (scheme == null && uri.getScheme() != null) |
1272 |
return -1; |
return -1; |
1273 |
if (scheme != null) |
if (scheme != null) |