Money class

@fileoverview A model which can represent money. Will be wrong for yen.

Implemented types

Constructors

Money(int value)
Value in cents
Money.fromDollars(int dollars, int cents)
factory

Properties

cents int
no setter
dollars int
no setter
hashCode int
The hash code for this object.
no setteroverride
isNonZero bool
no setter
isZero bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value int
final

Methods

getPercentageMore(Money other) int
Returns a approximation of many percent more than other money object, out of 100, as int
marshal(MarshalledObject marshalled) → void
serialise to this object.
override
min(Money minimum) Money
Returns input parameter if greater than self
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator *(int quantity) Money
Multiply money time quantity
operator +(Money other) Money
Add money
operator -(Money other) Money
Subtract money
operator ==(Object other) bool
The equality operator.
override

Static Properties

MAX_CENTS int
final
ZERO Money
final

Static Methods

sum(Iterable<Money> amounts) Money
unmarshal(MarshalledObject marshalled) Money