001 package data.filters; 002 003 import data.*; 004 005 import java.text.ParseException; 006 007 /** 008 * A CatalogFilter that filters {@link Currency Currencies}. 009 * 010 * @author Steffen Zschaler 011 * @version 2.0 19/08/1999 012 * @since v2.0 013 */ 014 public abstract class CurrencyFilter extends CatalogFilter implements Currency { 015 016 /** 017 * Create a new CurrencyFilter. 018 * 019 * @param c the Currency to be filtered. 020 */ 021 public CurrencyFilter(Currency c) { 022 super(c); 023 } 024 025 /** 026 * Convert the given value to its {@link String} representation using the source Currency. 027 * 028 * @override Never 029 */ 030 public String toString(NumberValue nv) { 031 return ((Currency)m_cOrg).toString(nv); 032 } 033 034 /** 035 * Try to parse the given {@link String} as a Currency value using the source Currency. 036 * 037 * @override Never 038 */ 039 public NumberValue parse(String s) throws ParseException { 040 return ((Currency)m_cOrg).parse(s); 041 } 042 }