com.ibm.icu.text
Class CurrencyMetaInfo.CurrencyFilter

java.lang.Object
  extended by com.ibm.icu.text.CurrencyMetaInfo.CurrencyFilter
Enclosing class:
CurrencyMetaInfo

public static final class CurrencyMetaInfo.CurrencyFilter
extends java.lang.Object

A filter used to select which currency info is returned.

Status:
Draft ICU 4.4.

Field Summary
 java.lang.String currency
          The currency to filter on.
 long from
          The from date to filter on (milliseconds).
 java.lang.String region
          The region to filter on.
 long to
          The to date to filter on (milliseconds).
 
Method Summary
static CurrencyMetaInfo.CurrencyFilter all()
          Returns a filter that accepts all currency data.
 boolean equals(CurrencyMetaInfo.CurrencyFilter rhs)
          Type-safe override of equals(Object).
 boolean equals(java.lang.Object rhs)
          Overrides equals.
 int hashCode()
          Overrides hashCode.
static CurrencyMetaInfo.CurrencyFilter now()
          Returns a filter that accepts all currencies in use as of the current date.
static CurrencyMetaInfo.CurrencyFilter onCurrency(java.lang.String currency)
          Returns a filter that accepts the given currency.
static CurrencyMetaInfo.CurrencyFilter onDate(java.util.Date date)
          Returns a filter that accepts all currencies in use on the given date.
static CurrencyMetaInfo.CurrencyFilter onRange(java.util.Date from, java.util.Date to)
          Returns a filter that accepts all currencies that were in use at some point between the given dates, or if dates are equal, currencies in use on that date.
static CurrencyMetaInfo.CurrencyFilter onRegion(java.lang.String region)
          Returns a filter that accepts all currencies ever used in the given region.
 java.lang.String toString()
          Returns a string representing the filter, for debugging.
 CurrencyMetaInfo.CurrencyFilter withCurrency(java.lang.String currency)
          Returns a copy of this filter, with the specified currency.
 CurrencyMetaInfo.CurrencyFilter withDate(java.util.Date date)
          Returns a copy of this filter, with from and to set to the given date.
 CurrencyMetaInfo.CurrencyFilter withRange(java.util.Date from, java.util.Date to)
          Returns a copy of this filter, with from and to set to the given dates.
 CurrencyMetaInfo.CurrencyFilter withRegion(java.lang.String region)
          Returns a copy of this filter, with the specified region.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

region

public final java.lang.String region
The region to filter on. If null, accepts any region.

Status:
Draft ICU 4.4.

currency

public final java.lang.String currency
The currency to filter on. If null, accepts any currency.

Status:
Draft ICU 4.4.

from

public final long from
The from date to filter on (milliseconds). Accepts any currency on or after this date.

Status:
Draft ICU 4.4.

to

public final long to
The to date to filter on (milliseconds). Accepts any currency on or before this date.

Status:
Draft ICU 4.4.
Method Detail

all

public static CurrencyMetaInfo.CurrencyFilter all()
Returns a filter that accepts all currency data.

Returns:
a filter
Status:
Draft ICU 4.4.

now

public static CurrencyMetaInfo.CurrencyFilter now()
Returns a filter that accepts all currencies in use as of the current date.

Returns:
a filter
See Also:
withDate(Date)
Status:
Draft ICU 4.4.

onRegion

public static CurrencyMetaInfo.CurrencyFilter onRegion(java.lang.String region)
Returns a filter that accepts all currencies ever used in the given region.

Parameters:
region - the region code
Returns:
a filter
See Also:
withRegion(String)
Status:
Draft ICU 4.4.

onCurrency

public static CurrencyMetaInfo.CurrencyFilter onCurrency(java.lang.String currency)
Returns a filter that accepts the given currency.

Parameters:
currency - the currency code
Returns:
a filter
See Also:
withCurrency(String)
Status:
Draft ICU 4.4.

onDate

public static CurrencyMetaInfo.CurrencyFilter onDate(java.util.Date date)
Returns a filter that accepts all currencies in use on the given date.

Parameters:
date - the date
Returns:
a filter
See Also:
withDate(Date)
Status:
Draft ICU 4.4.

onRange

public static CurrencyMetaInfo.CurrencyFilter onRange(java.util.Date from,
                                                      java.util.Date to)
Returns a filter that accepts all currencies that were in use at some point between the given dates, or if dates are equal, currencies in use on that date.

Parameters:
from - date on or after a currency must have been in use
to - date before which a currency must have been in use, or if equal to from, the date on which a currency must have been in use
Returns:
a filter
See Also:
withRange(Date, Date)
Status:
Draft ICU 4.4.

withRegion

public CurrencyMetaInfo.CurrencyFilter withRegion(java.lang.String region)
Returns a copy of this filter, with the specified region. Region can be null to indicate no filter on region.

Parameters:
region - the region code
Returns:
the filter
See Also:
onRegion(String)
Status:
Draft ICU 4.4.

withCurrency

public CurrencyMetaInfo.CurrencyFilter withCurrency(java.lang.String currency)
Returns a copy of this filter, with the specified currency. Currency can be null to indicate no filter on currency.

Parameters:
currency - the currency code
Returns:
the filter
See Also:
onCurrency(String)
Status:
Draft ICU 4.4.

withDate

public CurrencyMetaInfo.CurrencyFilter withDate(java.util.Date date)
Returns a copy of this filter, with from and to set to the given date.

Parameters:
date - the date on which the currency must have been in use
Returns:
the filter
See Also:
onDate(Date)
Status:
Draft ICU 4.4.

withRange

public CurrencyMetaInfo.CurrencyFilter withRange(java.util.Date from,
                                                 java.util.Date to)
Returns a copy of this filter, with from and to set to the given dates.

Parameters:
from - date on or after which the currency must have been in use
to - date before which the currency must have been in use
Returns:
the filter
See Also:
onRange(Date, Date)
Status:
Draft ICU 4.4.

equals

public boolean equals(java.lang.Object rhs)
Overrides equals.

Overrides:
equals in class java.lang.Object
Status:
Draft ICU 4.4.

equals

public boolean equals(CurrencyMetaInfo.CurrencyFilter rhs)
Type-safe override of equals(Object).

Parameters:
rhs - the currency filter to compare to
Returns:
true if the filters are equal
Status:
Draft ICU 4.4.

hashCode

public int hashCode()
Overrides hashCode.

Overrides:
hashCode in class java.lang.Object
Status:
Draft ICU 4.4.

toString

public java.lang.String toString()
Returns a string representing the filter, for debugging.

Overrides:
toString in class java.lang.Object
Status:
Draft ICU 4.4.


Copyright (c) 2011 IBM Corporation and others.