|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.math.DefaultUnit
public class DefaultUnit
simple base implementation for a unit
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.util.Localizable |
|---|
Localizable.Adapter |
| Field Summary | |
|---|---|
protected String |
name
|
protected String |
symbol
|
| Constructor Summary | |
|---|---|
DefaultUnit(String symbol)
|
|
DefaultUnit(String symbol,
String name)
the symbol must not be null; if the name is null, the symbol is used as the name |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
instances are considered equals if the class and the symbol are the same |
Locale |
getLocale()
allows access to the Locale that this instance currently uses to localize its messages, |
String |
getUnitName()
provides the fully spelled name for this unit |
String |
getUnitSymbol()
provides a short symbolic representation of this unit |
int |
hashCode()
based on getUnitSymbol() |
void |
setLocale(Locale locale,
Object context)
sets the Locale for this object so that all subsequent return values of method calls to this instance can be localized accordingly until a different Locale is set. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final String symbol
protected final String name
| Constructor Detail |
|---|
public DefaultUnit(String symbol)
public DefaultUnit(String symbol,
String name)
| Method Detail |
|---|
public Locale getLocale()
Localizable
getLocale in interface LocalizableLocalizable.setLocale(Locale, Object)
public void setLocale(Locale locale,
Object context)
Localizable
setLocale in interface Localizablelocale - the Locale that is to be used to determine return values for all methods
of this instance; if set to null, the default locale is to be used.context - a context that may be required for this instance to load the resources for the given locale;
this context may be null for objects that do not require an external context.
Examples of a context may be a database, a resource file, some map or no context at all.Localizable.getLocale()public String getUnitSymbol()
Unit
getUnitSymbol in interface Unitpublic String getUnitName()
Unit
getUnitName in interface Unitpublic String toString()
toString in class Objectpublic int hashCode()
getUnitSymbol()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||