|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bristle.javalib.util.ListUtil
public class ListUtil
This class contains utility routines for manipulating Java Lists.
Usage:
- The typical scenario for using this class is:
String str1 = ListUtil.listToString(list1);
- See the source code of the inner Tester class for more examples.
Assumptions:
Effects:
- None.
Anticipated Changes:
Notes:
Implementation Notes:
Portability Issues:
Revision History:
$Log$
| Nested Class Summary | |
|---|---|
static class |
ListUtil.Tester
Each class contains a Tester inner class with a main() for easier unit testing. |
| Constructor Summary | |
|---|---|
ListUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
haveEqualContents(List list1,
List list2)
Return true if the two Lists contains equal elements or are both null or both empty; false otherwise. |
static boolean |
haveIdenticalContents(List list1,
List list2)
Return true if the two Lists contains the same elements or are both null or both empty; false otherwise. |
static String |
listToString(List list)
Return a String version of the List. |
static List |
toList(Enumeration enumeration)
Return a new List copied from the specified Enumeration, or null if the Enumeration is null. |
static List |
toList(Iterator iter)
Return a new List copied from the specified Iterator, or null if the Iterator is null. |
static List |
toList(Object[] arr)
Create a List from the specified array. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListUtil()
| Method Detail |
|---|
public static String listToString(List list)
list - List to convert to a String.
public static List toList(Object[] arr)
arr - Array of Objects to put in the List.
public static List toList(Iterator iter)
iter - Iterator to copy to a new List.
public static List toList(Enumeration enumeration)
enumeration - Enumeration to copy to a new List.
public static boolean haveIdenticalContents(List list1,
List list2)
list1 - List to compare.list2 - List to compare.
public static boolean haveEqualContents(List list1,
List list2)
list1 - List to compare.list2 - List to compare.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||