Class/Object

com.vsthost.rnd.parala

Money

Related Docs: object Money | package parala

Permalink

final case class Money[A <: Currency](ccy: A, qty: QTY, dov: DATE) extends Product with Serializable

Defines a data model for monetary values and operations defined on monetary value instances.

A

The type parameter defining the currency of the monetary value.

ccy

The currency of the monetary value.

qty

The quantity of the monetary value.

dov

The date the monetary value is effective as of.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Money
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Money(ccy: A, qty: QTY, dov: DATE)

    Permalink

    ccy

    The currency of the monetary value.

    qty

    The quantity of the monetary value.

    dov

    The date the monetary value is effective as of.

Value Members

  1. def !+:![B <: CCY](o: Money[B])(implicit converter: Converter): OptMoney[B]

    Permalink

    Provides an addition operation with conversion semantics preserving right operand's currency in the return value.

    Provides an addition operation with conversion semantics preserving right operand's currency in the return value.

    B

    The type parameter defining the currency of the right operand.

    o

    The monetary value to add to this.

    converter

    The implicit foreign exchange rate converter.

    returns

    Some monetary value instance as the sum of two operands if foreign exchange rate is defined, None otherwise.

  2. def !-:![B <: CCY](o: Money[B])(implicit converter: Converter): OptMoney[B]

    Permalink

    Provides a subtraction operation with conversion semantics preserving right operand's currency in the return value.

    Provides a subtraction operation with conversion semantics preserving right operand's currency in the return value.

    B

    The type parameter defining the currency of the right operand.

    o

    The monetary value to subtract from this.

    converter

    The implicit foreign exchange rate converter.

    returns

    Some monetary value instance as the difference of two operands if foreign exchange rate is defined, None otherwise.

  3. def !/![B <: CCY](o: Money[B])(implicit converter: Converter): Option[QTY]

    Permalink

    Provides a monetary division operation.

    Provides a monetary division operation.

    o

    The divisor.

    returns

    Some of the ratio if conversion is required and successful, None otherwise.

  4. def !:+![B <: CCY](o: Money[B])(implicit converter: Converter): OptMoney[A]

    Permalink

    Provides an addition operation with conversion semantics preserving left operand's currency in the return value.

    Provides an addition operation with conversion semantics preserving left operand's currency in the return value.

    B

    The type parameter defining the currency of the right operand.

    o

    The monetary value to add to this.

    converter

    The implicit foreign exchange rate converter.

    returns

    Some monetary value instance as the sum of two operands if foreign exchange rate is defined, None otherwise.

  5. def !:-![B <: CCY](o: Money[B])(implicit converter: Converter): OptMoney[A]

    Permalink

    Provides a subtraction operation with conversion semantics preserving left operand's currency in the return value.

    Provides a subtraction operation with conversion semantics preserving left operand's currency in the return value.

    B

    The type parameter defining the currency of the right operand.

    o

    The monetary value to subtract from this.

    converter

    The implicit foreign exchange rate converter.

    returns

    Some monetary value instance as the difference of two operands if foreign exchange rate is defined, None otherwise.

  6. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  8. def %%[B <: CCY](to: B)(implicit converter: Converter): OptMoney[B]

    Permalink

    Converts the monetary value instance to a new one with target currency.

    Converts the monetary value instance to a new one with target currency.

    B

    The Currency type which the conversion will be targeted at.

    to

    Target currency.

    returns

    An optional new monetary value instance if the conversion is successful, None otherwise.

  9. def %*%[B <: CCY](rate: Rate[A, B]): Money[B]

    Permalink

    Returns the converted monetary value as of the given foreign exchange rate.

    Returns the converted monetary value as of the given foreign exchange rate.

    rate

    Foreign exchange rate.

    returns

    A new Money instance which is converted from this.

  10. def %/%[B <: CCY](rate: Rate[B, A]): Money[B]

    Permalink

    Returns the converted monetary value as of the given foreign exchange rate.

    Returns the converted monetary value as of the given foreign exchange rate.

    rate

    Foreign exchange rate.

    returns

    A new Money instance which is converted from this.

  11. def *(o: QTY): Money[A]

    Permalink

    Provides a scalar multiplication operation.

    Provides a scalar multiplication operation.

    o

    The scalar term to be multiplied with the quantity of this.

    returns

    A new Money instance of which the quantity is the multiplication of o and the quantity of this.

  12. def +(o: QTY): Money[A]

    Permalink

    Provides a scalar addition operation.

    Provides a scalar addition operation.

    o

    The scalar term to be added to the quantity of this.

    returns

    A new Money instance of which the quantity is the sum of the quantity of this and o.

  13. def -(o: QTY): Money[A]

    Permalink

    Provides a scalar subtraction operation.

    Provides a scalar subtraction operation.

    o

    The scalar term to be subtracted from the quantity of this.

    returns

    A new Money instance of which the quantity is the subtraction of o from the quantity of this.

  14. def /(o: QTY): Money[A]

    Permalink

    Provides a scalar division operation.

    Provides a scalar division operation.

    o

    The scalar term by which to divide the quantity of this.

    returns

    A new Money instance of which the quantity is the division of the quantity of this by o.

  15. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. def abs(): Money[A]

    Permalink

    Returns the absolute monetary value.

    Returns the absolute monetary value.

    returns

    A new Money instance of which the quantity is the absolute quantity of this.

  17. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  18. val ccy: A

    Permalink

    The currency of the monetary value.

  19. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. def cmap[B <: CCY](f: (A) ⇒ B): Money[B]

    Permalink

    Provides a function to map a given function over the currency and return a new monetary value instance.

    Provides a function to map a given function over the currency and return a new monetary value instance.

    B

    The type parameter defining the new currency to be produced.

    f

    Function which consumes the currency of the monetary value and returns a new currency.

    returns

    A new Money instance of which the currency is defined by the application of the f function.

  21. def dmap(f: (DATE) ⇒ DATE): Money[A]

    Permalink

    Provides a function to map a given function over the date of value and return a new monetary value instance.

    Provides a function to map a given function over the date of value and return a new monetary value instance.

    f

    Function which consumes the date of value and returns a new date of value.

    returns

    New Money instance of which the date of value is defined by the application of the f function.

  22. val dov: DATE

    Permalink

    The date the monetary value is effective as of.

  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def inv(): Money[A]

    Permalink

    Returns the inverted monetary value (by qty' => 1 / qty).

    Returns the inverted monetary value (by qty' => 1 / qty).

    returns

    A new Money instance of which the quantity is the inverted quantity of this.

  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. def pow(n: Int): Money[A]

    Permalink

    Returns the exponentiated monetary value.

    Returns the exponentiated monetary value.

    n

    The exponent.

    returns

    A new Money instance of which the quantity is the exponentiation of the quantity of this by n.

  32. def qbi(f: (QTY, QTY) ⇒ QTY)(o: QTY): Money[A]

    Permalink

    Defines a function which creates a binary, scalar function, applies to this and o and return a new monetary value.

    Defines a function which creates a binary, scalar function, applies to this and o and return a new monetary value.

    f

    The binary, scalar function.

    o

    The scalar term.

    returns

    A new Money instance of which the quantity is defined by the application of the f function.

  33. def qmap(f: (QTY) ⇒ QTY): Money[A]

    Permalink

    Provides a function to map a given function over the quantity and return a new monetary value instance.

    Provides a function to map a given function over the quantity and return a new monetary value instance.

    f

    Function which consumes the quantity and returns a new quantity.

    returns

    New Money instance of which the quantity is defined by the application of the f function.

  34. val qty: QTY

    Permalink

    The quantity of the monetary value.

  35. def quantize: Money[A]

    Permalink

    Removes redundant precision by properly rounding Money.qty as per Money.ccy type.

    Removes redundant precision by properly rounding Money.qty as per Money.ccy type.

    returns

    A new Money instance of which the quantity is the quantized quantity of this.

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def unary_-(): Money[A]

    Permalink

    Returns the negated monetary value.

    Returns the negated monetary value.

    returns

    A new Money instance of which the quantity is the negated quantity of this.

  38. def vmap[B <: CCY](f: (A, QTY, DATE) ⇒ Money[B]): Money[B]

    Permalink

    Provides a function to map a given function over the value slots and return a new monetary value instance.

    Provides a function to map a given function over the value slots and return a new monetary value instance.

    B

    Specific Currency type which is returned by the f function.

    f

    Function which consumes a tuple of all value slots and returns a new monetary value instance.

    returns

    A new Money instance as returned by the f function.

  39. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def |+|(o: Money[A]): Money[A]

    Permalink

    Provides a simple monetary addition operation over same currency monetary values.

    Provides a simple monetary addition operation over same currency monetary values.

    o

    Monetary value to be added.

    returns

    A new Money instance which is the addition of two monetary values.

  43. def |-|(o: Money[A]): Money[A]

    Permalink

    Provides a simple monetary subtraction operation over same currency monetary values.

    Provides a simple monetary subtraction operation over same currency monetary values.

    o

    Monetary value to be subtracted.

    returns

    A new Money instance which is the subtraction of two monetary values.

  44. def |/|(o: Money[A]): QTY

    Permalink

    Provides a simple monetary division operation over same currency monetary values.

    Provides a simple monetary division operation over same currency monetary values.

    o

    Monetary value to divide this by.

    returns

    The ratio of quantities of the two monetary value instances.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped