Methods Summary |
---|
public static java.lang.Class | getUniformClass(java.util.Iterator iter)
Class theClass = null;
Object next;
if ( iter.hasNext() )
{
next = iter.next();
theClass = (next == null) ? null : next.getClass();
}
while ( iter.hasNext() )
{
next = iter.next();
if ( next != null && next.getClass() != theClass )
{
theClass = null;
break;
}
}
return( theClass );
|
public static boolean | isUniformClass(java.util.Iterator iter, java.lang.Class theClass, boolean exactMatch)
boolean isUniform = true;
while ( iter.hasNext() )
{
Object next = iter.next();
final Class nextClass = (next == null) ? null : next.getClass();
if ( nextClass != theClass && nextClass != null )
{
if ( exactMatch )
{
isUniform = false;
break;
}
if ( ! theClass.isAssignableFrom( nextClass ) )
{
isUniform = false;
break;
}
}
}
return( isUniform );
|
public static java.lang.Object[] | toArray(java.util.Iterator iter)
final List<T> list = new ArrayList<T>();
while ( iter.hasNext() )
{
final T elem = iter.next();
list.add( elem );
}
final Object[] result = new Object[ list.size() ];
list.toArray( result );
return( ArrayConversion.specializeArray( result ) );
|