Package com.ibm.icu.text
Class CurrencyMetaInfo.CurrencyFilter
- java.lang.Object
-
- com.ibm.icu.text.CurrencyMetaInfo.CurrencyFilter
-
- Enclosing class:
- CurrencyMetaInfo
public static final class CurrencyMetaInfo.CurrencyFilter extends Object
A filter used to select which currency info is returned.
-
-
Field Summary
Fields Modifier and Type Field Description StringcurrencyThe currency to filter on.longfromThe from date to filter on (as milliseconds).StringregionThe region to filter on.booleantenderOnlyDeprecated.This API is ICU internal only.longtoThe to date to filter on (as milliseconds).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CurrencyMetaInfo.CurrencyFilterall()Returns a filter that accepts all currency data.booleanequals(CurrencyMetaInfo.CurrencyFilter rhs)Type-safe override ofequals(Object).booleanequals(Object rhs)Compares this instance with the specified object and indicates if they are equal.inthashCode()Returns an integer hash code for this object.static CurrencyMetaInfo.CurrencyFilternow()Returns a filter that accepts all currencies in use as of the current date.static CurrencyMetaInfo.CurrencyFilteronCurrency(String currency)Returns a filter that accepts the given currency.static CurrencyMetaInfo.CurrencyFilteronDate(long date)Returns a filter that accepts all currencies in use on the given date.static CurrencyMetaInfo.CurrencyFilteronDate(Date date)Returns a filter that accepts all currencies in use on the given date.static CurrencyMetaInfo.CurrencyFilteronDateRange(long from, long 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.CurrencyFilteronDateRange(Date from, 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.CurrencyFilteronRegion(String region)Returns a filter that accepts all currencies ever used in the given region.static CurrencyMetaInfo.CurrencyFilteronTender()Returns a CurrencyFilter for finding currencies that were either once used, are used, or will be used as tender.StringtoString()Returns a string representing the filter, for debugging.CurrencyMetaInfo.CurrencyFilterwithCurrency(String currency)Returns a copy of this filter, with the specified currency.CurrencyMetaInfo.CurrencyFilterwithDate(long date)Returns a copy of this filter that accepts all currencies in use on the given date.CurrencyMetaInfo.CurrencyFilterwithDate(Date date)Returns a copy of this filter, with from and to set to the given date.CurrencyMetaInfo.CurrencyFilterwithDateRange(long from, long to)Returns a copy of this 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.CurrencyMetaInfo.CurrencyFilterwithDateRange(Date from, Date to)Returns a copy of this filter, with from and to set to the given dates.CurrencyMetaInfo.CurrencyFilterwithRegion(String region)Returns a copy of this filter, with the specified region.CurrencyMetaInfo.CurrencyFilterwithTender()Returns a copy of this filter that filters for currencies that were either once used, are used, or will be used as tender.
-
-
-
Field Detail
-
region
public final String region
The region to filter on. If null, accepts any region.
-
currency
public final String currency
The currency to filter on. If null, accepts any currency.
-
from
public final long from
The from date to filter on (as milliseconds). Accepts any currency on or after this date.
-
to
public final long to
The to date to filter on (as milliseconds). Accepts any currency on or before this date.
-
tenderOnly
@Deprecated public final boolean tenderOnly
Deprecated.This API is ICU internal only.true if we are filtering only for currencies used as legal tender.
-
-
Method Detail
-
all
public static CurrencyMetaInfo.CurrencyFilter all()
Returns a filter that accepts all currency data.- Returns:
- a filter
-
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)
-
onRegion
public static CurrencyMetaInfo.CurrencyFilter onRegion(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)
-
onCurrency
public static CurrencyMetaInfo.CurrencyFilter onCurrency(String currency)
Returns a filter that accepts the given currency.- Parameters:
currency- the currency code- Returns:
- a filter
- See Also:
withCurrency(String)
-
onDate
public static CurrencyMetaInfo.CurrencyFilter onDate(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)
-
onDateRange
public static CurrencyMetaInfo.CurrencyFilter onDateRange(Date from, 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 useto- date on or 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:
withDateRange(Date, Date)
-
onDate
public static CurrencyMetaInfo.CurrencyFilter onDate(long date)
Returns a filter that accepts all currencies in use on the given date.- Parameters:
date- the date as milliseconds after Jan 1, 1970
-
onDateRange
public static CurrencyMetaInfo.CurrencyFilter onDateRange(long from, long 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- The date on or after a currency must have been in use. Measured in milliseconds since Jan 1, 1970 GMT.to- The date on or before which a currency must have been in use. Measured in milliseconds since Jan 1, 1970 GMT.
-
onTender
public static CurrencyMetaInfo.CurrencyFilter onTender()
Returns a CurrencyFilter for finding currencies that were either once used, are used, or will be used as tender.
-
withRegion
public CurrencyMetaInfo.CurrencyFilter withRegion(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)
-
withCurrency
public CurrencyMetaInfo.CurrencyFilter withCurrency(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)
-
withDate
public CurrencyMetaInfo.CurrencyFilter withDate(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)
-
withDateRange
public CurrencyMetaInfo.CurrencyFilter withDateRange(Date from, 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 useto- date on or before which the currency must have been in use- Returns:
- the filter
- See Also:
onDateRange(Date, Date)
-
withDate
public CurrencyMetaInfo.CurrencyFilter withDate(long date)
Returns a copy of this filter that accepts all currencies in use on the given date.- Parameters:
date- the date as milliseconds after Jan 1, 1970
-
withDateRange
public CurrencyMetaInfo.CurrencyFilter withDateRange(long from, long to)
Returns a copy of this 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- The date on or after a currency must have been in use. Measured in milliseconds since Jan 1, 1970 GMT.to- The date on or before which a currency must have been in use. Measured in milliseconds since Jan 1, 1970 GMT.
-
withTender
public CurrencyMetaInfo.CurrencyFilter withTender()
Returns a copy of this filter that filters for currencies that were either once used, are used, or will be used as tender.
-
equals
public boolean equals(Object rhs)
Compares this instance with the specified object and indicates if they are equal. In order to be equal,omust represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.The default implementation returns
trueonly ifthis == o. See Writing a correctequalsmethod if you intend implementing your ownequalsmethod.The general contract for the
equalsandObject.hashCode()methods is that ifequalsreturnstruefor any two objects, thenhashCode()must return the same value for these objects. This means that subclasses ofObjectusually override either both methods or neither of them.- Overrides:
equalsin classObject- Parameters:
rhs- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
equals
public boolean equals(CurrencyMetaInfo.CurrencyFilter rhs)
Type-safe override ofequals(Object).- Parameters:
rhs- the currency filter to compare to- Returns:
- true if the filters are equal
-
hashCode
public int hashCode()
Returns an integer hash code for this object. By contract, any two objects for whichObject.equals(java.lang.Object)returnstruemust return the same hash code value. This means that subclasses ofObjectusually override both methods or neither method.Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCodemethod if you intend implementing your ownhashCodemethod.- Overrides:
hashCodein classObject- Returns:
- this object's hash code.
- See Also:
Object.equals(java.lang.Object)
-
-