SalesPoint Framework v3.0

data.ooimpl
Class CatalogItemImpl

java.lang.Object
  |
  +--data.AbstractNameable
        |
        +--data.ooimpl.CatalogItemImpl
Direct Known Subclasses:
CatalogImpl, CurrencyItemImpl

public abstract class CatalogItemImpl
extends AbstractNameable
implements CatalogItem, DataBasketKeys

Pure Java implementation of the CatalogItem interface. See the documentation for CatalogItem for a description of the semantics of this class.

Hooks:
Define CatalogItem
Since:
v2.0
Version:
2.0 19/08/1999
Author:
Steffen Zschaler
See Also:
Serialized Form

Fields inherited from class data.AbstractNameable
m_ncContext, m_pcsPropertyListeners
 
Constructor Summary
CatalogItemImpl(String sName)
          Create a new CatalogItemImpl.
CatalogItemImpl(String sName, Value vValue)
          Create a new CatalogItemImpl.
 
Method Summary
 void addValueListener(PropertyChangeListener pcl)
          Add a PropertyChangeListener that will receive events whenever the "value" property changes.
 int compareTo(Object o)
          Compare this CatalogItem to an object.
 boolean equals(Object o)
          Check whether two objects are equal.
 Catalog getCatalog()
          Get the Catalog of this CatalogItem.
protected abstract  CatalogItemImpl getShallowClone()
          Get a shallow clone of the CatalogItem.
 Value getValue()
          Get the item's value.
 boolean isEditable()
          Return true if this CatalogItem is editable.
 void removeValueListener(PropertyChangeListener pcl)
          Remove a PropertyChangeListener for the "value" property.
protected  void setValue(Value vNew)
          Set the item's value.
 String toString()
          Return a String representation of the item.
 
Methods inherited from class data.AbstractNameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CatalogItemImpl

public CatalogItemImpl(String sName)
Create a new CatalogItemImpl. The item's value defaults to an IntegerValue of 0.
Parameters:
sName - the name of the new item.

CatalogItemImpl

public CatalogItemImpl(String sName,
                       Value vValue)
Create a new CatalogItemImpl.
Parameters:
sName - the name of the new item.
vValue - the value of the item.
Method Detail

getValue

public Value getValue()
Get the item's value.
Override:
Never.
Specified by:
getValue in interface CatalogItem
Returns:
a clone of the item's value.

setValue

protected void setValue(Value vNew)
Set the item's value. This method is protected so that subclasses can decide whether or not to allow clients to set the value of a CatalogItem once it has been created.

The method will fire a property change event for the "value" property.

Override:
Sometimes.

isEditable

public boolean isEditable()
Return true if this CatalogItem is editable.
Override:
Never.

getCatalog

public Catalog getCatalog()
Get the Catalog of this CatalogItem.
Override:
Never.
Specified by:
getCatalog in interface CatalogItem

toString

public String toString()
Return a String representation of the item.
Override:
Sometimes.
Overrides:
toString in class Object

getShallowClone

protected abstract CatalogItemImpl getShallowClone()
Get a shallow clone of the CatalogItem. For normal CatalogItem's there is no difference between a shallow and a deep clone.
Override:
Always.
Hooks:
Define CatalogItem

compareTo

public int compareTo(Object o)
Compare this CatalogItem to an object.
Override:
Sometimes.
The default implementation assumes that the given object is also a CatalogItem and compares the values of these two CatalogItems.
Throws:
ClassCastException - if the given object cannot be cast into a CatalogItem.
Hooks:
Define CatalogItem

equals

public boolean equals(Object o)
Check whether two objects are equal.
Override:
Sometimes.
The default implementation returns true iff o is identical to this object.
Overrides:
equals in class Object
Hooks:
Define CatalogItem

addValueListener

public void addValueListener(PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever the "value" property changes.
Override:
Never.
Specified by:
addValueListener in interface CatalogItem

removeValueListener

public void removeValueListener(PropertyChangeListener pcl)
Remove a PropertyChangeListener for the "value" property.
Override:
Never.
Specified by:
removeValueListener in interface CatalogItem

SalesPoint Framework v3.0