Class CurrencyMetaInfo.CurrencyFilter

  • Enclosing class:
    CurrencyMetaInfo

    public static final class CurrencyMetaInfo.CurrencyFilter
    extends Object
    A filter used to select which currency info is returned.
    Status:
    Stable ICU 4.4.
    • Field Detail

      • region

        public final String region
        The region to filter on. If null, accepts any region.
        Status:
        Stable ICU 4.4.
      • currency

        public final String currency
        The currency to filter on. If null, accepts any currency.
        Status:
        Stable ICU 4.4.
      • from

        public final long from
        The from date to filter on (as milliseconds). Accepts any currency on or after this date.
        Status:
        Stable ICU 4.4.
      • to

        public final long to
        The to date to filter on (as milliseconds). Accepts any currency on or before this date.
        Status:
        Stable ICU 4.4.
      • 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.
        Status:
        Internal. This API is ICU internal only.
    • Method Detail

      • 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 use
        to - 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)
        Status:
        Stable ICU 49.
      • 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
        Status:
        Stable ICU 51.
      • 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.
        Status:
        Stable ICU 51.
      • 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.
        Status:
        Stable ICU 51.
      • 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)
        Status:
        Stable ICU 4.4.
      • 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)
        Status:
        Stable ICU 4.4.
      • 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)
        Status:
        Stable ICU 4.4.
      • 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 use
        to - date on or before which the currency must have been in use
        Returns:
        the filter
        See Also:
        onDateRange(Date, Date)
        Status:
        Stable ICU 49.
      • 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
        Status:
        Stable ICU 51.
      • 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.
        Status:
        Stable ICU 51.
      • 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.
        Status:
        Stable ICU 51.
      • equals

        public boolean equals​(Object rhs)
        Overrides:
        equals in class Object
        Status:
        Stable 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:
        Stable ICU 4.4.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
        Status:
        Stable ICU 4.4.
      • toString

        public String toString()
        Returns a string representing the filter, for debugging.
        Overrides:
        toString in class Object
        Returns:
        A string representing the filter.
        Status:
        Stable ICU 4.4.