ucar.units
Class PrefixSymbol
java.lang.Object
ucar.units.Prefix
ucar.units.PrefixSymbol
- All Implemented Interfaces:
- java.lang.Comparable
public final class PrefixSymbol
- extends Prefix
Provides support for prefix symbols.
Instances of this class are immutable.
- Version:
- $Id: PrefixSymbol.java 64 2006-07-12 22:30:50Z edavis $
- Author:
- Steven R. Emmerson
|
Constructor Summary |
PrefixSymbol(java.lang.String name,
double value)
Constructs from a name and a numeric value. |
|
Method Summary |
int |
compareTo(java.lang.Object obj)
Compares this prefix against another PrefixSymbol. |
int |
compareTo(java.lang.String string)
Compares this prefix against a String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PrefixSymbol
public PrefixSymbol(java.lang.String name,
double value)
- Constructs from a name and a numeric value.
- Parameters:
name - The name for the prefix.value - The numeric value for the prefix.
compareTo
public final int compareTo(java.lang.Object obj)
- Compares this prefix against another PrefixSymbol. The sort keys are
decreasing length (major) and increasing lexicality (minor).
- Specified by:
compareTo in interface java.lang.Comparable- Specified by:
compareTo in class Prefix
- Parameters:
obj - The other PrefixSymbol.
- Returns:
- A negative value, zero, or a positive value
depending on whether this PrefixSymbol is less
than, equal to, or greater than
obj, respectively.
compareTo
public final int compareTo(java.lang.String string)
- Compares this prefix against a String. The sort keys are
decreasing length (major) and increasing lexicality (minor).
- Specified by:
compareTo in class Prefix
- Parameters:
string - The string.
- Returns:
- A negative value, zero, or a positive value
depending on whether this PrefixSymbol is less
than, equal to, or greater than
string, respectively.