Algernon Software

org.algernon.util
Class CollectionUtil

java.lang.Object
  extended byorg.algernon.util.CollectionUtil

public class CollectionUtil
extends Object


Constructor Summary
CollectionUtil()
           
 
Method Summary
static String collectionToNumberedList(Collection values)
          Returns a numbered, indented list with the values and an index number.
static Object first(Collection c)
          Returns the first element in a collection.
static Collection objectsToCollection(Object o)
          Turns an object into a Collection containing just the object.
static Collection objectsToCollection(Object o1, Object o2)
          Turns two objects into a Collection containing just the objects.
static Collection objectsToCollection(Object o1, Object o2, Object o3)
          Turns three objects into a Collection containing just the objects.
static Collection objectsToCollection(Object o1, Object o2, Object o3, Object o4)
          Turns four objects into a Collection containing just the objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtil

public CollectionUtil()
Method Detail

objectsToCollection

public static Collection objectsToCollection(Object o)
Turns an object into a Collection containing just the object. Uses an ArrayList.


objectsToCollection

public static Collection objectsToCollection(Object o1,
                                             Object o2)
Turns two objects into a Collection containing just the objects. Uses an ArrayList.


objectsToCollection

public static Collection objectsToCollection(Object o1,
                                             Object o2,
                                             Object o3)
Turns three objects into a Collection containing just the objects. Uses an ArrayList.


objectsToCollection

public static Collection objectsToCollection(Object o1,
                                             Object o2,
                                             Object o3,
                                             Object o4)
Turns four objects into a Collection containing just the objects. Uses an ArrayList.


first

public static Object first(Collection c)
Returns the first element in a collection. If the collection is empty or the collection is null, this method returns null.


collectionToNumberedList

public static String collectionToNumberedList(Collection values)
Returns a numbered, indented list with the values and an index number.

Parameters:
values -

Algernon Software