|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.CollectionUtil
public final class CollectionUtil
Various static utility methods for collections, lists, maps etc.
| Field Summary | |
|---|---|
static java.util.Vector |
EMPTY_VECTOR
Empty vector |
| Method Summary | |
|---|---|
static void |
add(java.util.List list,
int index,
java.lang.Object element)
Adds a object to a list and extends the list by null values if the index is greater than the size. |
static void |
addAll(java.util.Collection c,
java.util.Enumeration en)
Adds the elements of an enumeration to a collection. |
static void |
addAll(java.util.Collection c,
java.util.Iterator it)
Adds the elements of an enumeration to a collection. |
static void |
addAll(java.util.Collection c,
java.lang.Object[] array)
Adds the elements of an array to a collection. |
static void |
addReverseList(java.util.Collection col,
java.util.List result)
Adds the elements of the given collection to the given list in reverse order. |
static java.util.Collection |
collection(java.lang.Object o)
This method returns a collection built based on the passed object. |
static boolean |
containsReference(java.util.Collection c,
java.lang.Object object)
Checks if a collection contains the specified element. |
static java.util.Iterator |
iterator(java.lang.Object o)
This method returns an iterator built based on the passed object. |
static java.util.ArrayList |
iteratorToArrayList(java.util.Iterator it)
Creates ArrayList from a iterator |
static void |
removeReference(java.util.Collection c,
java.lang.Object object)
Removes an object from a collection. |
static java.lang.Object[] |
toArray(java.util.Collection c,
java.lang.Class cls)
Gets the objects of a collection as type-safe array (copy). |
static java.lang.String[] |
toStringArray(java.util.Collection c)
Gets the objects of a collection as array of strings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Vector EMPTY_VECTOR
| Method Detail |
|---|
public static boolean containsReference(java.util.Collection c,
java.lang.Object object)
c - Collection to search or nullobject - Object to search for
public static void removeReference(java.util.Collection c,
java.lang.Object object)
c - Collection to search or nullobject - Object to remove
java.lang.UnsupportedOperationException - if the \cremove\c operation is not supported
by the iterator returned by c.iterator ().public static java.util.Iterator iterator(java.lang.Object o)
o - The object to be converted into an iterator
public static java.util.Collection collection(java.lang.Object o)
o - The object to be converted into an iterator
public static void addAll(java.util.Collection c,
java.util.Iterator it)
c - Collection to add the objects toit - Iterator to add
public static void addAll(java.util.Collection c,
java.util.Enumeration en)
c - Collection to add the objects toen - Enumeration to add
public static void addAll(java.util.Collection c,
java.lang.Object[] array)
c - Collection to add the objects toarray - Array to addpublic static java.util.ArrayList iteratorToArrayList(java.util.Iterator it)
it - Iterator
public static java.lang.Object[] toArray(java.util.Collection c,
java.lang.Class cls)
c - Collection of objects or nullcls - The type of the array elements or null to generate a generic Object array
public static java.lang.String[] toStringArray(java.util.Collection c)
c - Collection of objects or null
public static void addReverseList(java.util.Collection col,
java.util.List result)
col - Collection to addresult - Result list
public static void add(java.util.List list,
int index,
java.lang.Object element)
list - Any list objectindex - The index position within the listelement - The element to add
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||