com.sage.accpac.sm
Class Currency

java.lang.Object
  extended by com.sage.accpac.sm.Currency

@Immutable
@ThreadSafe
public final class Currency
extends java.lang.Object

Provides details of a currency code set up in Common Services
An object of this class can be obtained from a DBLink object's getCurrency(...) method. An object of this class generally reflects the state of the data when the object was constructed, except that the block master properties reflect the state when those calls are made.

Thread safety
Immutable and therefore thread-safe

Nested Class Summary
static class Currency.BlockDateMatch
          Indicates the date matching method used to determine if a currency belongs to a currency block
static class Currency.DateMatch
          Indicates the date matching method used when determining an exchange rate with respect to a given date
static class Currency.NegativeDisplay
          Indicates how negative currency amounts should be displayed
static class Currency.SymbolDisplay
          Indicates how the currency symbol should be displayed with a currency amount
 
Method Summary
 CurrencyRate getBlockRate(java.util.Date date, Currency.BlockDateMatch match)
          Gets the exchange rate between this currency and its block master at the given date, returning null if not a member of a block.
 java.lang.String getCode()
          Gets the code of the currency
 int getDecimals()
          Gets the number of decimal places that should be used when displaying amounts in the currency
 char getDecimalSeparator()
          Gets the decimal separator character
 java.lang.String getDescription()
          Gets the description of the currency
 Currency.NegativeDisplay getNegativeDisplay()
          Gets the negative amount display format of the currency
 java.lang.String getSymbol()
          Gets the currency symbol for the currency
 Currency.SymbolDisplay getSymbolDisplay()
          Gets the currency symbol display format for the currency
 char getThousandSeparator()
          Gets the thousand separator character
 boolean isBlockCombinationWith(java.lang.String other, java.util.Date date, Currency.BlockDateMatch match)
          Determines if this currency is in the same block as the specified currency at the specified date
 boolean isBlockMaster(java.util.Date date, Currency.BlockDateMatch match)
          Determines if the currency is a block master currency at the given date The value returned reflects the state of the underlying data when the call is made, not when the Currency object was constructed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBlockRate

public CurrencyRate getBlockRate(java.util.Date date,
                                 Currency.BlockDateMatch match)
Gets the exchange rate between this currency and its block master at the given date, returning null if not a member of a block.
The data returned reflects the state of the underlying data when the call is made, not when the Currency object was constructed.

Parameters:
date - the date for which the rate should be found
match - how the date should be used
Returns:
a CurrencyRate object for the specified rate

getCode

public java.lang.String getCode()
Gets the code of the currency


getDecimals

public int getDecimals()
Gets the number of decimal places that should be used when displaying amounts in the currency


getDecimalSeparator

public char getDecimalSeparator()
Gets the decimal separator character


getDescription

public java.lang.String getDescription()
Gets the description of the currency


getNegativeDisplay

public Currency.NegativeDisplay getNegativeDisplay()
Gets the negative amount display format of the currency


getSymbol

public java.lang.String getSymbol()
Gets the currency symbol for the currency


getSymbolDisplay

public Currency.SymbolDisplay getSymbolDisplay()
Gets the currency symbol display format for the currency


getThousandSeparator

public char getThousandSeparator()
Gets the thousand separator character


isBlockCombinationWith

public boolean isBlockCombinationWith(java.lang.String other,
                                      java.util.Date date,
                                      Currency.BlockDateMatch match)
Determines if this currency is in the same block as the specified currency at the specified date


isBlockMaster

public boolean isBlockMaster(java.util.Date date,
                             Currency.BlockDateMatch match)
Determines if the currency is a block master currency at the given date The value returned reflects the state of the underlying data when the call is made, not when the Currency object was constructed.

Parameters:
date - the date for which the check should be made
match - specifies how the date should be used in deciding if the currency is a block master currency
Returns:
true if the currency is a block master at that date, false if it is not


Copyright © 2010 Sage Software, Inc. All rights reserved.