| |
|
| java.lang.Object de.danet.an.util.CollectionsUtil
CollectionsUtil | public class CollectionsUtil (Code) | | This class provides some helper methods for the use of the Java
collection framework (this includes both collections and maps).
author: version: $Revision: 1.4 $ |
Inner Class :public static class TrackedList implements List | |
Method Summary | |
public static boolean | hasBeenModified(Map map) Check if the given map has been modified. | public static boolean | hasBeenModified(List list) Check if the given list has been modified. | public static boolean | isTracked(Map map) Check if the given map is a tracked map. | public static boolean | isTracked(List list) Check if the given list is a tracked list. | public static Set | modifiedEntries(Map map) Returns the modified entries in the given map. | public static String | toString(Map map) Generate a string representation of a map for debugging
purposes. | public static List | trackedList(List list) Factory method for creating a new tracked list out of an "ordinary" List.
Parameters: list - the backing list for modification tracking. | public static Map | trackedMap(Map map) Factory method for creating a new tracked map out of an "ordinary" Map.
Parameters: map - the backing map for modification tracking. |
hasBeenModified | public static boolean hasBeenModified(Map map)(Code) | | Check if the given map has been modified. The method resets the
internal modified flag as it is assumed that after calling this
method some synchronization will be done and tracking starts
anew.
The method throws an IllegalArgumentException if
the argument is not a result of
CollectionsUtil.trackedMaptrackedMap , i.e. if isTracked(map) ==
false .
Parameters: map - the backing map for modification tracking. true if map has been modified, otherwise false. |
hasBeenModified | public static boolean hasBeenModified(List list)(Code) | | Check if the given list has been modified. The method resets the
internal modified flag as it is assumed that after calling this
method some synchronization will be done and tracking starts
anew.
The method throws an IllegalArgumentException if
the argument is not a result of
CollectionsUtil.trackedListtrackedList , i.e. if isTracked(list) ==
false .
Parameters: list - the list to be checked. true if list has been modified, otherwise false. |
isTracked | public static boolean isTracked(Map map)(Code) | | Check if the given map is a tracked map.
Parameters: map - the map to be tested true if map is tracked, otherwise false. |
isTracked | public static boolean isTracked(List list)(Code) | | Check if the given list is a tracked list.
Parameters: list - the list to be tested true if list is tracked, otherwise false. |
modifiedEntries | public static Set modifiedEntries(Map map)(Code) | | Returns the modified entries in the given map. The method
resets the internal modified flag as it is assumed that after
calling this method some synchronization will be done and
tracking starts anew.
The method throws an IllegalArgumentException if
the argument is not a result of
CollectionsUtil.trackedMaptrackedMap , i.e. if isTracked(map) ==
false .
Parameters: map - the backing map for modification tracking. true if map has been modified, otherwise false. |
toString | public static String toString(Map map)(Code) | | Generate a string representation of a map for debugging
purposes.
Parameters: map - the map string representation |
trackedList | public static List trackedList(List list)(Code) | | Factory method for creating a new tracked list out of an "ordinary" List.
Parameters: list - the backing list for modification tracking. a tracked list as a List. |
trackedMap | public static Map trackedMap(Map map)(Code) | | Factory method for creating a new tracked map out of an "ordinary" Map.
Parameters: map - the backing map for modification tracking. a tracked map as a Map. |
|
|
|