|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.silverpeas.util.CollectionUtil
public class CollectionUtil
Constructor Summary | |
---|---|
CollectionUtil()
|
Method Summary | ||
---|---|---|
static
|
addAllIgnoreNull(Collection<? super T> c,
T... elements)
Null elements are not taking into account. |
|
static
|
asList(T... values)
|
|
static
|
asSet(T... values)
|
|
static
|
extractFrom(Class<T> aClass,
Collection<?> collection,
String propertyName)
Extracting a property. |
|
static
|
extractFrom(Class<T> aClass,
Collection<?> collection,
String propertyNameToExtract,
String propertyNameToCompare,
Object givenValueToCompare,
boolean nullValueExtracted)
Extracting a property from elements that each has an other property with a given value |
|
static
|
extractFrom(Collection<?> collection,
String propertyName)
Extracting a property. |
|
static
|
extractFrom(Collection<?> collection,
String propertyName,
boolean isListOfArray,
int numberColumn)
Extracting a property. |
|
static
|
intersection(List<T> list1,
List<T> list2)
Makes an intersection betwwen both of the given lists. |
|
static
|
isEmpty(Collection<T> collection)
Checks if the given collection is not instancied or empty |
|
static
|
isNotEmpty(Collection<T> collection)
Checks if the given collection is instancied and not empty |
|
static
|
listToMap(Collection<T> collection,
ExtractionList<T,K,V> extractor)
Transforming a collection into a map |
|
static
|
reverse(List<T> list)
Reverse the given list and returns it. |
|
static
|
split(Collection<T> collection)
Splits a collection into several collections. |
|
static
|
split(Collection<T> collection,
int collectionSizeMax)
Splits a collection into several collections. |
|
static
|
union(List<T> list1,
List<T> list2)
Makes an union between both of the given lists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionUtil()
Method Detail |
---|
public static <T> List<T> reverse(List<T> list)
T
- list
-
public static <T> boolean isEmpty(Collection<T> collection)
T
- collection
-
public static <T> boolean isNotEmpty(Collection<T> collection)
T
- collection
-
public static <T> Collection<Collection<T>> split(Collection<T> collection)
collection
-
public static <T> Collection<Collection<T>> split(Collection<T> collection, int collectionSizeMax)
collection
- collectionSizeMax
-
public static <T,K,V> HashMap<K,V> listToMap(Collection<T> collection, ExtractionList<T,K,V> extractor)
T
- collection type elementsK
- map type keyV
- map type valuecollection
- extractor
- extractor interface
public static <T> Collection<T> extractFrom(Class<T> aClass, Collection<?> collection, String propertyName)
aClass
- property class to extractcollection
- collection from that to extractpropertyName
- name of the property
public static <T> Collection<T> extractFrom(Collection<?> collection, String propertyName)
collection
- collection from that to extractpropertyName
- name of the property
public static <T> Collection<T> extractFrom(Collection<?> collection, String propertyName, boolean isListOfArray, int numberColumn)
collection
- collection from that to extractpropertyName
- name of the propertyisListOfArray
- indicates if the list is an array listnumberColumn
- column index to extract from the array
public static <T> Collection<T> extractFrom(Class<T> aClass, Collection<?> collection, String propertyNameToExtract, String propertyNameToCompare, Object givenValueToCompare, boolean nullValueExtracted)
class
- property class to extractcollection
- element collectionpropertyNameToExtract
- name property to extractpropertyNameToCompare
- name value to comparegivenValueToCompare
- value to comparenullValueExtracted
- null value extracted
public static <T> List<T> asList(T... values)
public static <T> Set<T> asSet(T... values)
public static <T> boolean addAllIgnoreNull(Collection<? super T> c, T... elements)
Collections.addAll(java.util.Collection, Object[])
public static <T> List<T> union(List<T> list1, List<T> list2)
T
- list1
- the first list.list2
- the second list.
public static <T> List<T> intersection(List<T> list1, List<T> list2)
T
- list1
- the first list.list2
- the second list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |