net.sf.composite.util
Class ContainerUtils
java.lang.Object
net.sf.composite.util.ContainerUtils
public class ContainerUtils
- extends java.lang.Object
Utility functions for working with container-like objects such as Collections
and arrays.
- Since:
- Mar 11, 2005
- Author:
- Matt Sgarlata
Method Summary |
static java.util.List |
getElementsOfType(java.util.Collection collection,
java.lang.Class type)
|
static java.lang.Object[] |
getElementsOfType(java.lang.Object[] array,
java.lang.Class type)
|
static java.util.Iterator |
getIterator(java.lang.Object container)
Returns an iterator over the contents of the given container. |
static boolean |
hasElementOfType(java.lang.Object container,
java.lang.Class type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContainerUtils
public ContainerUtils()
getElementsOfType
public static java.lang.Object[] getElementsOfType(java.lang.Object[] array,
java.lang.Class type)
getElementsOfType
public static java.util.List getElementsOfType(java.util.Collection collection,
java.lang.Class type)
hasElementOfType
public static boolean hasElementOfType(java.lang.Object container,
java.lang.Class type)
getIterator
public static java.util.Iterator getIterator(java.lang.Object container)
- Returns an iterator over the contents of the given container.
- Parameters:
container
- the container
- Returns:
null
, if container is null
or
an iterator over the contents of the container, otherwise
- Throws:
java.lang.IllegalArgumentException
- if an iterator over the contents of the container could not
be constructed
Copyright © 2005-2008.