7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
8 |
the Free Software Foundation; either version 2, or (at your option) |
the Free Software Foundation; either version 2, or (at your option) |
9 |
any later version. |
any later version. |
10 |
|
|
11 |
GNU Classpath is distributed in the hope that it will be useful, but |
GNU Classpath is distributed in the hope that it will be useful, but |
12 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
65 |
* <p>OIDs may be relative, in which case the first two elements of the |
* <p>OIDs may be relative, in which case the first two elements of the |
66 |
* OID are omitted. |
* OID are omitted. |
67 |
* |
* |
68 |
* @author Casey Marshall (rsdio@metastatic.org) |
* @author Casey Marshall (csm@gnu.org) |
69 |
*/ |
*/ |
70 |
public class OID implements Cloneable, Comparable, java.io.Serializable |
public class OID implements Cloneable, Comparable, java.io.Serializable |
71 |
{ |
{ |
336 |
|
|
337 |
/* Nice idea, but possibly too expensive for whatever benefit it |
/* Nice idea, but possibly too expensive for whatever benefit it |
338 |
* provides. |
* provides. |
339 |
|
|
340 |
public String getShortName() |
public String getShortName() |
341 |
{ |
{ |
342 |
return OIDTable.getShortName(this); |
return OIDTable.getShortName(this); |
391 |
*/ |
*/ |
392 |
public boolean equals(Object o) |
public boolean equals(Object o) |
393 |
{ |
{ |
394 |
if (this == o) |
if (!(o instanceof OID)) |
395 |
return true; |
return false; |
396 |
return java.util.Arrays.equals(components, ((OID) o).components); |
return java.util.Arrays.equals(components, ((OID) o).components); |
397 |
} |
} |
398 |
|
|
411 |
*/ |
*/ |
412 |
public int compareTo(Object o) |
public int compareTo(Object o) |
413 |
{ |
{ |
414 |
if (o == this) |
if (equals(o)) |
415 |
return 0; |
return 0; |
416 |
int[] components2 = ((OID) o).components; |
int[] components2 = ((OID) o).components; |
417 |
int len = Math.min(components.length, components2.length); |
int len = Math.min(components.length, components2.length); |