FileDocCategorySizeDatePackage
LogRelationUtils.javaAPI DocAzureus 3.0.3.41657Mon Mar 19 13:12:20 GMT 2007org.gudy.azureus2.core3.logging

LogRelationUtils

public class LogRelationUtils extends Object
author
TuxPaper
created
Mar 19, 2007

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.ObjectqueryForClass(java.lang.Object[] objects, java.lang.Class cla)

		if (objects == null) {
			return null;
		}
		
		// Pass 1: Quick check if class is in objects
		for (int i = 0; i < objects.length; i++) {
			Object object = objects[i];
			if (cla.isInstance(object)) {
				return object;
			}
		}

		// Pass 2: check LogRelations
		for (int i = 0; i < objects.length; i++) {
			Object object = objects[i];
			if (object instanceof LogRelation) {
				LogRelation logRelation = (LogRelation)object;
				Object answer = logRelation.queryForClass(cla);
				if (answer != null) {
					return answer;
				}
			}
		}

		return null;