|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaseis.properties.Units
public class Units
This class provides a type-safe representation of units.
Field Summary | |
---|---|
static Units |
DEGREES
DEGREES of an angle |
static Units |
FEET
Feet |
static Units |
FT
Synonym for Feet such that FT.equals(FEET). |
static Units |
HERTZ
HERTZ |
static Units |
HZ
Synonym for HERTZ such that HZ.equals(HERTZ) |
static Units |
M
Synonym for Meters such that M.equals(METERS) |
static Units |
METERS
Meters |
static Units |
MILLISECONDS
MILLISECONDS |
static Units |
MS
Synonym for MILLISECONDS such that MS.equals(MILLISECONDS) |
static Units |
MSEC
Synonym for MILLISECONDS such that MSEC.equals(MILLISECONDS) |
static Units |
NULL
Unspecified value |
static Units |
SECONDS
SECONDS |
(package private) static long |
serialVersionUID
|
static Units |
UNKNOWN
Unknown value |
Constructor Summary | |
---|---|
Units(java.lang.String name)
Creates a new Units object with the description equal to the name. |
|
Units(java.lang.String name,
java.lang.String description)
Creates a new Units object with a description. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is equal to this object. |
static Units |
get(java.lang.String name)
Gets the units based on the name, or null if the name is not found. |
java.lang.String |
getDescription()
Returns the description the units. |
java.lang.String |
getName()
Returns the name the units. |
int |
hashCode()
Overrides Object.hashCode() because this class overrides Object.equals(). |
java.lang.String |
toString()
Returns a String representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Units DEGREES
public static final Units FEET
public static final Units FT
public static final Units HERTZ
public static final Units HZ
public static final Units M
public static final Units METERS
public static final Units MILLISECONDS
public static final Units MS
public static final Units MSEC
public static final Units NULL
public static final Units SECONDS
static final long serialVersionUID
public static final Units UNKNOWN
Constructor Detail |
---|
public Units(java.lang.String name)
Units
object with the description equal to the name.
name
- the units name. All names are reduced to lower case to
avoid similar but different names.public Units(java.lang.String name, java.lang.String description)
Units
object with a description.
name
- the units name. All names are reduced to lower case to
avoid similar but different names.description
- a description of the units.Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- an object.
true
if the input object equals this
object, otherwise false
.public static Units get(java.lang.String name)
name
- the name of the units.
public java.lang.String getDescription()
public java.lang.String getName()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
String
representation of the object.
toString
in class java.lang.Object
String
representation of the object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |