at.molindo.utils.collections
Class CollectionUtils

java.lang.Object
  extended by at.molindo.utils.collections.CollectionUtils

public class CollectionUtils
extends Object


Method Summary
static boolean empty(Collection<?> c)
           
static boolean empty(Map<?,?> c)
           
static
<T> T
first(Collection<T> c)
           
static
<K,V> Map.Entry<K,V>
first(Map<K,V> c)
           
static
<K> K
firstKey(Map<K,?> c)
           
static
<V> V
firstValue(Map<?,V> c)
           
static
<E> ArrayList<E>
list(E... e)
           
static
<E> ArrayList<E>
list(Iterable<E> e)
           
static
<K,V> V
putIfAbsent(ConcurrentMap<K,V> map, K key, V value)
           
static
<E> HashSet<E>
set(E... e)
           
static
<E> HashSet<E>
set(Iterable<E> e)
           
static
<E> TreeSet<E>
sortedSet(E... e)
           
static
<E> TreeSet<E>
sortedSet(Iterable<E> e)
           
static
<T> List<T>
subList(List<T> list, int first, int count)
          a sublist implementation that is diffrent from List.subList(int, int) as it handles out of bounds indexes gracefully
static
<E> List<E>
unmodifiableList(E... e)
           
static
<E> List<E>
unmodifiableList(Iterable<E> e)
           
static
<E> Set<E>
unmodifiableSet(E... e)
           
static
<E> Set<E>
unmodifiableSet(Iterable<E> e)
           
static
<E> SortedSet<E>
unmodifiableSortedSet(E... e)
           
static
<E> SortedSet<E>
unmodifiableSortedSet(Iterable<E> e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unmodifiableSet

public static <E> Set<E> unmodifiableSet(Iterable<E> e)

unmodifiableSet

public static <E> Set<E> unmodifiableSet(E... e)

set

public static <E> HashSet<E> set(E... e)

set

public static <E> HashSet<E> set(Iterable<E> e)

unmodifiableSortedSet

public static <E> SortedSet<E> unmodifiableSortedSet(E... e)

unmodifiableSortedSet

public static <E> SortedSet<E> unmodifiableSortedSet(Iterable<E> e)

sortedSet

public static <E> TreeSet<E> sortedSet(E... e)

sortedSet

public static <E> TreeSet<E> sortedSet(Iterable<E> e)

unmodifiableList

public static <E> List<E> unmodifiableList(E... e)

unmodifiableList

public static <E> List<E> unmodifiableList(Iterable<E> e)

list

public static <E> ArrayList<E> list(E... e)

list

public static <E> ArrayList<E> list(Iterable<E> e)

subList

public static <T> List<T> subList(List<T> list,
                                  int first,
                                  int count)
a sublist implementation that is diffrent from List.subList(int, int) as it handles out of bounds indexes gracefully


empty

public static boolean empty(Collection<?> c)

empty

public static boolean empty(Map<?,?> c)

first

public static <T> T first(Collection<T> c)

first

public static <K,V> Map.Entry<K,V> first(Map<K,V> c)

firstKey

public static <K> K firstKey(Map<K,?> c)

firstValue

public static <V> V firstValue(Map<?,V> c)

putIfAbsent

public static <K,V> V putIfAbsent(ConcurrentMap<K,V> map,
                                  K key,
                                  V value)


Copyright © 2011 Molindo GmbH. All Rights Reserved.