@Immutable
public abstract class Prefix
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>
Modifier | Constructor and Description |
---|---|
protected |
Prefix(java.lang.String id,
double value)
Constructs from an identifier and a value.
|
Modifier and Type | Method and Description |
---|---|
abstract int |
compareTo(java.lang.Object obj)
Compares this prefix to another.
|
abstract int |
compareTo(java.lang.String string)
Compares this prefix to a string.
|
java.lang.String |
getID()
Gets the prefix identifier.
|
double |
getValue()
Gets the prefix value.
|
int |
length()
Return the length of the prefix identifier.
|
java.lang.String |
toString()
Returns the string representation of this prefix.
|
protected Prefix(java.lang.String id, double value)
id
- The prefix identifier (e.g. "milli" or "m").value
- The prefix value (e.g. 1e-3).public final java.lang.String getID()
public final java.lang.String toString()
toString
in class java.lang.Object
public final double getValue()
public abstract int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable<java.lang.Object>
obj
- The other prefix.obj
.public abstract int compareTo(java.lang.String string)
string
- The string.public final int length()