|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.patterns.ordereddata.util.OrderedDataUtils
public final class OrderedDataUtils
Utility methods for data object order manipulation.
| Field Summary | |
|---|---|
static java.lang.String |
ORDERED_ITEMS_POSTFIX
Postfix for name of the hidden variable for particular dataobject. |
| Method Summary | |
|---|---|
static byte |
compare(int[] arrIdentifiers,
java.util.List lstList)
Compare array of ids and list of objects to find out if the order of the object as changed or if some objects were newly added or removed. |
static byte |
compare(java.util.List lstList1,
java.util.List lstList2)
Compare lists of objects to find out if their order or attributes were changed or if some objects were added or deleted. |
static java.lang.String |
getEncodedOrder(java.util.Collection colDataObjects)
Construct string representation of all ordered items contained within the specified collection. |
static int |
getOrder(java.lang.String strOrderedItems,
int iItemId)
Get order number for specified id encoded in the specified string |
static java.util.Collection |
updateOrder(javax.servlet.http.HttpServletRequest hsrqRequest,
java.util.Collection colDataObjects,
java.lang.String strParamPrefix)
Parse order numbers and set it up into collection of dataobject. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ORDERED_ITEMS_POSTFIX
| Method Detail |
|---|
public static java.util.Collection updateOrder(javax.servlet.http.HttpServletRequest hsrqRequest,
java.util.Collection colDataObjects,
java.lang.String strParamPrefix)
hsrqRequest - - HTTP request containing request parameter defining
order of data objects. The value format is documented
in ORDERED_ITEMS_POSTFIX.colDataObjects - - collection of data objects whose order number
needs to be updated from the values passed in the
request. The collection will be also sorted by the
order numberstrParamPrefix - - prefix for hidden variable storing changed IDs. The
prefix has to be followed by ORDERED_ITEMS_POSTFIX
so that the whole request parameter name is prefix
+ postfix.
public static int getOrder(java.lang.String strOrderedItems,
int iItemId)
strOrderedItems - - string specifying order of data objects identifiable
by their ids. Format of the string is
ID1:ORDER_NUMBER1;...;IDn:ORDER_NUMBERniItemId - - id of item for which we need to get order
public static java.lang.String getEncodedOrder(java.util.Collection colDataObjects)
colDataObjects - - collection of ordered data objects for which the
order string will be constructed for
public static byte compare(java.util.List lstList1,
java.util.List lstList2)
lstList1 - - first list to comparelstList2 - - second list to compare
public static byte compare(int[] arrIdentifiers,
java.util.List lstList)
arrIdentifiers - - array of ints - ids of the data objectlstList - - list of data object to compare with the ist of ids
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||