|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.catalog.comparison.ComparisonList
public class ComparisonList
ComparisonList maintains a list of items that the user might want to compare with each other, together with an associated set of sort directives to apply when displaying the items in the list.
Like Java List classes, ComparisonList maintains the insertion order of items in the list. Unlike the List classes, it prohibits duplicate entries in the list by ignoring requests to add items that compare equal to items already in the list.
ComparisonList wraps access to the list in synchronized blocks to assure that all operations on the list are carried out atomically. This makes it possible for multiple request-scoped droplets and form handlers to operate on a shared session-scoped ComparisonList safely, as long as all changes to the list are made through the ComparisonList API.
If an application calls getItems()
to obtain a direct
reference to the list, the application could should either perform
all access to the list within synchronized blocks that synchronize
on the list itself, or call the synchronizedList
method
of java.util.Collections
to obtain a synchronized version
of the list and access the list through the synchronized wrapper.
TableInfo
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ComparisonList()
|
Method Summary | |
---|---|
boolean |
addItem(java.lang.Object pItem)
Add an item to the end of the comparison list if and only if it was not already present in the list. |
void |
clear()
Remove all items from the comparison list. |
boolean |
containsItem(java.lang.Object pItem)
Return true if the comparison list contains the specified item. |
java.lang.Object |
getItem(int pIndex)
Return the item at the specified index in the comparison list. |
java.util.List |
getItems()
Get the list of items being compared. |
java.lang.String |
getPrimarySortString()
Get a string suitable for use with the sortProperties parameter of droplets like ForEach, representing the sort direction and property name for the first entry in the list of sort criteria. |
java.lang.String |
getSortString()
Get a string suitable for use with the sortProperties parameter of droplets like ForEach, representing the sort direction and property name for all entries in the list of sort criteria. |
TableInfo.Column[] |
getTableColumns()
|
TableInfo |
getTableInfo()
|
int |
indexOf(java.lang.Object pItem)
Return the index of the specified item in the comparison list, or -1 if the item does not appear in the list. |
java.lang.Object |
removeItem(int pIndex)
Remove an item from the comparison list if it was present in the list to begin with. |
boolean |
removeItem(java.lang.Object pItem)
Remove an item from the comparison list if it was present in the list to begin with. |
void |
setItems(java.util.List pItems)
Set the list of items being compared. |
void |
setTableInfo(TableInfo pTableInfo)
|
int |
size()
Return the number of items in the comparison list. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ComparisonList()
Method Detail |
---|
public void setItems(java.util.List pItems)
java.util.Collections.synchronizedList
so that multiple
request scoped form handlers can safely operate on session scoped
comparison lists.
public java.util.List getItems()
List
public void setTableInfo(TableInfo pTableInfo)
public TableInfo getTableInfo()
public TableInfo.Column[] getTableColumns()
public boolean addItem(java.lang.Object pItem)
pItem
- The object to add.
public boolean removeItem(java.lang.Object pItem)
pItem
- The object to remove.
public java.lang.Object removeItem(int pIndex)
pIndex
- The index position of the object to remove.
public boolean containsItem(java.lang.Object pItem)
list_element.equals(pItem)
. Therefore, the items in
question need not be the same object so long as the list element's
equals method considers them equal to one another.
public int indexOf(java.lang.Object pItem)
public java.lang.Object getItem(int pIndex)
public int size()
public void clear()
public java.lang.String getSortString()
This method is just shorthand for calling
getSortProperties().getSortString()
public java.lang.String getPrimarySortString()
This method is just shorthand for calling
getSortProperties().getPrimarySortString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |