|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.data.AbstractNameable
org.salespointframework.core.data.StockItemImpl
public class StockItemImpl
Pure Java implementation of the StockItem
interface. See the documentation for
StockItem
for a description of the semantics of this class.
Field Summary | |
---|---|
(package private) static int |
COMMIT_ACTION
|
private int |
m_id
Unique id of item |
private StockImpl<?,?,?> |
m_stiOwner
The Stock that contains this StockItem . |
(package private) static int |
ROLLBACK_ACTION
|
(package private) static int |
STARTEDIT_ACTION
|
Fields inherited from class org.salespointframework.core.data.AbstractNameable |
---|
m_ncContext, m_pcsPropertyListeners, SOME_PROPERTY |
Fields inherited from interface org.salespointframework.core.data.interfaces.Nameable |
---|
NAME_PROPERTY |
Fields inherited from interface org.salespointframework.core.data.interfaces.DataBasketKeys |
---|
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY |
Constructor Summary | |
---|---|
StockItemImpl(java.lang.String sName)
Create a new StockItemImpl. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone this StockItem. |
int |
compareTo(java.lang.Object o)
Compare this StockItem to the given object. |
boolean |
equals(java.lang.Object o)
Check whether this StockItem equals the given object. |
void |
firePropertyChanged()
Signals persistence layer to update objects values |
CatalogItem |
getAssociatedItem(DataBasket db)
Get the CatalogItem that is associated with this StockItem. |
StockItemImpl |
getShallowClone()
Get a shallow clone of this item. |
StockImpl<?,?,?> |
getStock()
Get the Stock that contains this StockItem. |
(package private) void |
internalSetName(java.lang.String sNewName)
Internal communication method needed for referential integrity in StoringStocks. |
void |
recover(java.util.Map<java.lang.String,java.lang.Object> data,
java.lang.Object recoveryContext,
boolean reInit)
Set the stock on recovery |
(package private) void |
relinkCatalog(DataBasket db,
int nAction)
Helper method used to maintain StockImpl - CatalogImpl links in nested Stocks/Catalogs. |
protected void |
setStock(StockImpl<?,?,?> sti)
Set the Stock that contains this StockItem. |
java.lang.String |
toString()
Return a String representation of the item. |
Methods inherited from class org.salespointframework.core.data.AbstractNameable |
---|
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.salespointframework.core.data.interfaces.Nameable |
---|
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
Methods inherited from interface org.salespointframework.core.data.interfaces.SpItem |
---|
getName |
Field Detail |
---|
private StockImpl<?,?,?> m_stiOwner
Stock
that contains this StockItem
.
private int m_id
static final int COMMIT_ACTION
static final int ROLLBACK_ACTION
static final int STARTEDIT_ACTION
Constructor Detail |
---|
public StockItemImpl(java.lang.String sName)
sName
- the name of the new item.Method Detail |
---|
public StockImpl<?,?,?> getStock()
getStock
in interface StockItem
public CatalogItem getAssociatedItem(DataBasket db)
If the StockItem
has a Stock
, the associated CatalogItem
is the
CatalogItem of the same name that is found in the Stock's associated Catalog
.
Otherwise, it is null
.
getAssociatedItem
in interface StockItem
db
- the DataBasket used to determine visibility.protected void setStock(StockImpl<?,?,?> sti)
public java.lang.Object clone()
clone
in interface StockItem
clone
in class java.lang.Object
public StockItemImpl getShallowClone()
For a normal item, shallow and deep clones are identical, which is why the default implementation
returns ((StockItemImpl) clone())
. However, when making a shallow clone of a Stock, the
individual StockItems will not be cloned.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable<java.lang.Object>
java.lang.ClassCastException
- if the given object cannot be converted into a StockItem
.void internalSetName(java.lang.String sNewName)
Attention: This method must not be called directly.
public java.lang.String toString()
toString
in class java.lang.Object
void relinkCatalog(DataBasket db, int nAction)
db
- the DataBasket that protecting this activity.nAction
- the action that occurred. Can be either COMMIT_ACTION
, ROLLBACK_ACTION
,
STARTEDIT_ACTION
.public void recover(java.util.Map<java.lang.String,java.lang.Object> data, java.lang.Object recoveryContext, boolean reInit)
recover
in interface Recoverable
data
- field to value mappingreInit
- true, id recover was called more than one time on this objectpublic void firePropertyChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |