Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

3.2 Currency Information Classes

The C++ version of the currency class is RWCurrency and the Java version is Currency. Both classes store the following currency information:

Notice that the currency information class does not contain information about the relative value of a currency to any other currency, nor does it specify any amounts. Money classes, described in Chapter 4, provide a mapping between a currency and an amount. A variety of currency exchange classes, described in Chapter 5, provide methods for converting from one currency to another.

When you construct a currency object in C++ or Java, the introduction and expiration dates are optional. For example the following line creates an RWCurrency object, USDollars:

In C++, when you omit the introduction and expiration dates they are replaced with two public static data members: RWCurrency::noIntroductionDate and RWCurrency::noExpirationDate. The data member noIntroductionDate represents a date that is before January 1, 1000. Similarly, noExpirationDate represents December 25, 9999. You can also use these data members in code to determine whether a currency object has an introduction of expiration date. The entry for RWCurrency in the class reference contains an example showing how the data members work.

In Java, when you omit the introduction and expiration dates they are replaced with data members DEFAULT_INTRODUCTION and DEFAULT_EXPIRATION.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.