SalesPoint v3.3 API

data.swing
Class CountingStockTableModel.Record

java.lang.Object
  extended by data.swing.CountingStockTableModel.Record
All Implemented Interfaces:
CatalogItem, Nameable, Serializable, Comparable<Object>
Enclosing class:
CountingStockTableModel

public static class CountingStockTableModel.Record
extends Object
implements CatalogItem

A CountingStockTableModel's record.

The record is basically a combination of a CatalogItem and a number indicating the number of objects available.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface data.CatalogItem
VALUE_PROPERTY
 
Fields inherited from interface data.Nameable
NAME_PROPERTY
 
Constructor Summary
CountingStockTableModel.Record(CatalogItem ci, int nCount)
          Create a new Record.
 
Method Summary
 void addNameListener(PropertyChangeListener pcl)
          Add a PropertyChangeListener that will receive events whenever the "name" property changes.
 void addPropertyChangeListener(PropertyChangeListener pcl)
          Register a listener to receive events whenever propertiy changes.
 void addValueListener(PropertyChangeListener pcl)
          Add a PropertyChangeListener that will receive events whenever the "value" property changes.
 NameContext attach(NameContext nc)
          Attach a NameContext to this Nameable.
 int compareTo(CountingStockTableModel.Record r)
          Compare by descriptor.
 int compareTo(Object arg0)
           
 NameContext detachNC()
          Detach the current NameContext from this Nameable.
 Catalog getCatalog()
          Get the Catalog that currently contains this CatalogItem.
 int getCount()
          Get the number of items in this record.
 CatalogItem getDescriptor()
          Get the CatalogItem describing the items represented by this record.
 String getName()
          Get the name of this Nameable object.
 Value getValue()
          Get the default value of this CatalogItem.
 void removeNameListener(PropertyChangeListener pcl)
          Remove a PropertyChangeListener for the "name" property.
 void removePropertyChangeListener(PropertyChangeListener pcl)
          Stop a listener from receiving events whenever a property changes.
 void removeValueListener(PropertyChangeListener pcl)
          Remove a PropertyChangeListener for the "value" property.
 void setName(String sName, DataBasket db)
          Set the Nameable's name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountingStockTableModel.Record

public CountingStockTableModel.Record(CatalogItem ci,
                                      int nCount)
Create a new Record.

Method Detail

compareTo

public int compareTo(CountingStockTableModel.Record r)
Compare by descriptor.


getDescriptor

public CatalogItem getDescriptor()
Get the CatalogItem describing the items represented by this record.


getCount

public int getCount()
Get the number of items in this record.


addNameListener

public void addNameListener(PropertyChangeListener pcl)
Description copied from interface: Nameable
Add a PropertyChangeListener that will receive events whenever the "name" property changes.

Specified by:
addNameListener in interface Nameable

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener pcl)
Description copied from interface: Nameable
Register a listener to receive events whenever propertiy changes.

Specified by:
addPropertyChangeListener in interface Nameable

addValueListener

public void addValueListener(PropertyChangeListener pcl)
Description copied from interface: CatalogItem
Add a PropertyChangeListener that will receive events whenever the "value" property changes.

Specified by:
addValueListener in interface CatalogItem

attach

public NameContext attach(NameContext nc)
Description copied from interface: Nameable
Attach a NameContext to this Nameable.

No naming conventions are checked neither in the old nor in the new NameContext.

Specified by:
attach in interface Nameable
Parameters:
nc - the new NameContext of this Nameable object.
Returns:
the previous NameContext, if any.

compareTo

public int compareTo(Object arg0)
Specified by:
compareTo in interface Comparable<Object>

detachNC

public NameContext detachNC()
Description copied from interface: Nameable
Detach the current NameContext from this Nameable.

Specified by:
detachNC in interface Nameable
Returns:
the previously attached NameContext, if any.

getCatalog

public Catalog getCatalog()
Description copied from interface: CatalogItem
Get the Catalog that currently contains this CatalogItem.

Specified by:
getCatalog in interface CatalogItem

getName

public String getName()
Description copied from interface: Nameable
Get the name of this Nameable object.

Specified by:
getName in interface Nameable

getValue

public Value getValue()
Description copied from interface: CatalogItem
Get the default value of this CatalogItem. Although CatalogItems have a default value, you can use any other value through the CatalogItemValue adapter.

Specified by:
getValue in interface CatalogItem

removeNameListener

public void removeNameListener(PropertyChangeListener pcl)
Description copied from interface: Nameable
Remove a PropertyChangeListener for the "name" property.

Specified by:
removeNameListener in interface Nameable

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener pcl)
Description copied from interface: Nameable
Stop a listener from receiving events whenever a property changes.

Specified by:
removePropertyChangeListener in interface Nameable

removeValueListener

public void removeValueListener(PropertyChangeListener pcl)
Description copied from interface: CatalogItem
Remove a PropertyChangeListener for the "value" property.

Specified by:
removeValueListener in interface CatalogItem

setName

public void setName(String sName,
                    DataBasket db)
             throws NameContextException
Description copied from interface: Nameable
Set the Nameable's name.

setName() must implement the following protocol (Let nc be the Nameable's current NameContext):

 if (nc != null) {
   synchronized (nc.getNCMonitor()) {
     nc.checkNameChange (db, getName(), sName);

     // set the internal name attribute(s), leaving old name in sOldName

     nc.nameHasChanged (db, sOldName, getName());
   }
 }
 else {
   // set the internal name attribute(s)
 }
 

Specified by:
setName in interface Nameable
Parameters:
sName - the new name of the object
db - the DataBasket relative to which the operation is to be performed.
Throws:
NameContextException - if the name change was not approved of by the NameContext.
See Also:
NameContext

SalesPoint v3.3 API