|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nlm.util.StringFieldComparator
Used to compare string field objects.
Constructor Summary | |
StringFieldComparator(String delim,
int field_num)
Instantiates a comparator for the specified parameters. |
|
StringFieldComparator(String delim,
int field_num,
boolean ascending)
Instantiates a comparator for the specified parameters. |
Method Summary | |
int |
compare(Object o1,
Object o2)
Compares the specified field of each String object. |
void |
setNumeric(boolean b)
Causes sort to be numeric |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
Constructor Detail |
public StringFieldComparator(String delim, int field_num)
delim
- a String
containing delimiter charactersfield_num
- an int
representation of field numberspublic StringFieldComparator(String delim, int field_num, boolean ascending)
delim
- a String
containing delimiter charactersfield_num
- an int
representation of field numbersascending
- true
if compare in ascending order;
false
otherwiseMethod Detail |
public void setNumeric(boolean b)
b
- boolean
public int compare(Object o1, Object o2)
String
object.
compare
in interface Comparator
o1
- the first Object
to be compared.o2
- the second Object
to be compared.
int
which might be negative integer, zero, or a positive integer
as the first argument is less than, equal to, or greater than the second.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |