001 package data; 002 003 import java.beans.PropertyChangeListener; 004 005 /** 006 * An item in a {@link Catalog}. 007 * 008 * <p>CatalogItems describe available objects by their attributes. The only attribute that is mandatory is 009 * a {@link Nameable#getName key} ({@link String}), usually a name, but it could be an ID-Number or 010 * anything. A CatalogItem can have a {@link #getValue value} attribute.<p> 011 * 012 * <p><strong>Note</strong> that the name as obtained via {@link Nameable#getName} is used as the 013 * CatalogItem's key when inserting the CatalogItem inside a Catalog.</p> 014 * 015 * <p>CatalogItems are contained in {@link Catalog Catalogs}.</p> 016 * 017 * @author Steffen Zschaler 018 * @version 2.0 18/08/1999 019 * @since v0.5 020 */ 021 public interface CatalogItem extends Nameable, Comparable { 022 023 /** 024 * The programmatical name for the "value" property. This is "value". 025 */ 026 public static final String VALUE_PROPERTY = "value"; 027 028 /** 029 * Get the default value of this CatalogItem. Although CatalogItems have a default value, you can use any 030 * other value through the {@link CatalogItemValue} adapter. 031 * 032 * @override Always 033 */ 034 public Value getValue(); 035 036 /** 037 * Get the Catalog that currently contains this CatalogItem. 038 * 039 * @override Always 040 */ 041 public Catalog getCatalog(); 042 043 /** 044 * Add a PropertyChangeListener that will receive events whenever the "value" property changes. 045 * 046 * @override Always 047 */ 048 public void addValueListener(PropertyChangeListener pcl); 049 050 /** 051 * Remove a PropertyChangeListener for the "value" property. 052 * 053 * @override Always 054 */ 055 public void removeValueListener(PropertyChangeListener pcl); 056 }