|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jaulp.collections.ListUtils
public class ListUtils
Utility class for the use of List object.
Constructor Summary | |
---|---|
ListUtils()
|
Method Summary | ||
---|---|---|
static
|
containAtleastOneObject(java.util.List<T> toSearch,
java.util.List<T> search)
This Method look in the List toSearch if at least one Object exists in the List search. |
|
static
|
getFirst(java.util.List<T> list)
Gets the first object from the given List. |
|
static
|
getLast(java.util.List<T> list)
Gets the last object from the given List. |
|
static
|
getSameElementsFromLists(java.util.List<T> toSearch,
java.util.List<T> search)
The Method looks at both List and if they have same objects they are added to one List and will returns the result. |
|
static boolean |
isNullOrEmpty(java.util.List list)
Checks if a List is null or empty. |
|
static void |
printCollection(java.util.Collection collection)
Helper-Method for printing a Collection in the console. |
|
static void |
printCollection(java.util.Collection collection,
java.io.OutputStream out)
Helper-Method for printing a Collection in the OutputStream. |
|
static java.lang.Object |
removeFirst(java.util.List list)
Removes the first object from the given List. |
|
static java.lang.Object |
removeLast(java.util.List list)
Removes the last object from the given List. |
|
static
|
removeLastValues(java.util.ArrayList<T> v,
int remove)
The Method removeLastValues(ArrayList, int) remove the last Values. |
|
static
|
revertOrder(java.util.List<T> listToRevert)
Reverts the order from the given List. |
|
static java.util.List |
splitListToParts(java.util.List list,
int times)
Splits the List to Parts to the specified times |
|
static
|
splitSetToParts(java.util.Set<T> set,
int times)
Splits the Set to Parts to the specified times |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListUtils()
Method Detail |
---|
public static <T> boolean containAtleastOneObject(java.util.List<T> toSearch, java.util.List<T> search)
toSearch
- The List to search.search
- The List to inspect.
public static <T> T getFirst(java.util.List<T> list)
list
- the List.
public static <T> T getLast(java.util.List<T> list)
list
- the List.
public static <T> java.util.List<T> getSameElementsFromLists(java.util.List<T> toSearch, java.util.List<T> search)
toSearch
- The List to search.search
- The List to inspect.
public static boolean isNullOrEmpty(java.util.List list)
list
- The List to check.
public static void printCollection(java.util.Collection collection)
collection
- The Collection to print.public static void printCollection(java.util.Collection collection, java.io.OutputStream out)
collection
- The Collection to print.public static java.lang.Object removeFirst(java.util.List list)
list
- the List.
public static java.lang.Object removeLast(java.util.List list)
list
- the List.
public static <T> java.util.List<T> removeLastValues(java.util.ArrayList<T> v, int remove)
v
- The Vector with the received Messages.remove
- How much to remove.public static <T> java.util.List<T> revertOrder(java.util.List<T> listToRevert)
listToRevert
- The List to revert.
public static java.util.List splitListToParts(java.util.List list, int times)
list
- The List to Splittimes
- How to split.
public static <T> java.util.List<java.util.List<T>> splitSetToParts(java.util.Set<T> set, int times)
set
- The Set to Splittimes
- How to split.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |