|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.timjohnstondev.unitconverter.model.Property
public class Property
A Property, such as temperature, pressure or length, has units and conversion factors or formulas to convert
between the different units.
| Constructor Summary | |
|---|---|
Property(String newName,
boolean isFormulaBased,
boolean canUseMoles)
Constructs a Property with the given name and specifies if it uses formulas or factors for unit conversion. |
|
| Method Summary | |
|---|---|
void |
addConversion(Conversion conversion)
Adds a Conversion which is a formula or factor that is used to perform unit conversions. |
int |
compareTo(Property prop)
|
String |
getName()
Returns this Property's name |
int |
getOrder()
Returns this Property's sort order |
boolean |
hasFormula()
Returns true if this Property uses formulas for unit conversion, else false |
void |
setOrder(int newOrder)
Sets this Property's sort order |
void |
setUnitSeparator(String symbol)
Updates the unit separator symbol |
boolean |
usesMoles()
Returns true if this Property can do mole to mass and mass to mole unit conversions, else false |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Property(String newName,
boolean isFormulaBased,
boolean canUseMoles)
Property with the given name and specifies if it uses formulas or factors for unit conversion.
newName - the descriptive name of this PropertyisFormulaBased - determines if this Property will use formulas or factors for unit conversioncanUseMoles - determines if this Property can do mole to mass and mass to mole unit conversions| Method Detail |
|---|
public final int getOrder()
Property's sort order
public final void setOrder(int newOrder)
Property's sort order
newOrder - the new sort order of this propertypublic final String getName()
Property's name
public final boolean usesMoles()
true if this Property can do mole to mass and mass to mole unit conversions, else false
true if this Property can do mole to mass and mass to mole unit conversions, else falsepublic final boolean hasFormula()
true if this Property uses formulas for unit conversion, else false
true if this Property uses formulas for unit conversion, else falsepublic final void addConversion(Conversion conversion)
Conversion which is a formula or factor that is used to perform unit conversions.
conversion - factor or formula to perform the conversionpublic final void setUnitSeparator(String symbol)
symbol - the new unit separator symbolpublic final int compareTo(Property prop)
compareTo in interface Comparable<Property>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||