Package overit.geocall.util
Class Euro
java.lang.Object
overit.geocall.util.Euro
- All Implemented Interfaces:
Serializable,Comparable
Utility class used to manage the object Euro
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected longprotected booleanstatic final longstatic final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMethod used to add Eurointdivide(double div) Method used to divide Eurodivide(int div) Method used to divide EurodoubleMethod used to divide EurodoubleReturns the Euro as doublebooleanReturns the unscaled valueinthashCode()booleanisGreaterOrEqualThan(Euro val) Method used to know if an Euro is grater or equal than anotherbooleanisGreaterThan(Euro val) Method used to know if an Euro is grater than anotherbooleanisSmallerOrEqualThan(Euro val) Method used to know if an Euro is smaller or equal than anotherbooleanisSmallerThan(Euro val) Method used to know if an Euro is smaller than anotherstatic voidmultiply(double mult) Method used to multiply Euromultiply(int mult) Method used to multiply Europercent(double percent) Method used to get the percent of an EurovoidsetPrecision(int p) Sets the precisionMethod used to subtract EurotoString()Returns the string representation of Euro
-
Field Details
-
MAX_VALUE
public static final long MAX_VALUE- See Also:
-
MIN_VALUE
public static final long MIN_VALUE- See Also:
-
_unscaledValue
protected long _unscaledValue -
isNull
protected boolean isNull -
_precision
protected int _precision
-
-
Constructor Details
-
Euro
public Euro(long unscaledValue) Creates a new instance of Euro- Parameters:
unscaledValue- Value without the scale
-
Euro
Creates a new instance of Euro- Parameters:
strValue- String containing the value
-
Euro
Creates a new instance of Euro- Parameters:
strValue- String containing the valuedecimalSep- String containing the decimal separatorgroupSep- String containing the group separator
-
-
Method Details
-
add
Method used to add Euro- Parameters:
val- Euro to add- Returns:
- The result of the sum
-
subtract
Method used to subtract Euro- Parameters:
val- Euro to subtract- Returns:
- The result of the subtraction
-
multiply
Method used to multiply Euro- Parameters:
mult- Euro to multiply- Returns:
- The result of the moltiplication
-
multiply
Method used to multiply Euro- Parameters:
mult- Euro to multiply- Returns:
- The result of the moltiplication
-
divide
Method used to divide Euro- Parameters:
div- Euro to divide- Returns:
- The result of the division
-
divide
Method used to divide Euro- Parameters:
div- Euro to divide- Returns:
- The result of the division
-
divide
Method used to divide Euro- Parameters:
div- Euro to divide- Returns:
- The result of the division
-
percent
Method used to get the percent of an Euro- Parameters:
percent- The percent value- Returns:
- The result of the percent
-
equals
-
hashCode
public int hashCode() -
isGreaterThan
Method used to know if an Euro is grater than another- Parameters:
val- Euro to consider- Returns:
trueif is greater,falseotherwise
-
isGreaterOrEqualThan
Method used to know if an Euro is grater or equal than another- Parameters:
val- Euro to consider- Returns:
trueif is greater or equal,falseotherwise
-
isSmallerThan
Method used to know if an Euro is smaller than another- Parameters:
val- Euro to consider- Returns:
trueif is smaller,falseotherwise
-
isSmallerOrEqualThan
Method used to know if an Euro is smaller or equal than another- Parameters:
val- Euro to consider- Returns:
trueif is smaller or equal,falseotherwise
-
setPrecision
public void setPrecision(int p) Sets the precision- Parameters:
p- The precision
-
toInputString
- Returns:
- see
getString()with "." as delimiter
-
toString
-
toString
Returns the string representation of Euro- Parameters:
decimalSep- String representing the decimal separatorgroupSep- String representing the group separator- Returns:
- The string representation of Euro
-
getUnscaledValue
Returns the unscaled value- Returns:
- The unscaled value
-
compareTo
- Specified by:
compareToin interfaceComparable
-
doubleValue
public double doubleValue()Returns the Euro as double- Returns:
- The Euro as double
-
main
-