On closer inspection:
/**
* Filters a collection objects. The returned collection
* only contains those objects that have an attribute of the
specified type.
*/
public static Collection getObjectsWithAttributeType (Collection
objects, Class attributeClass) {
ArrayList result = new ArrayList ();
Iterator iter = objects.iterator ();
while (iter.hasNext ()) {
Object object = iter.next ();
Class clazz = object.getClass ();
if (Attributes.hasAttributeType (clazz, attributeClass)) {
result.add (object);
}
}
return result;
}
is correct.
Because we want, for each object, to know if its class has a certain
attribute. If it does, then we return it.
/LS
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dan Diephouse
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]