01: /*
02: *
03: * Copyright 2007 by BBN Technologies Corporation
04: *
05: */
06:
07: package org.cougaar.util;
08:
09: /**
10: * General purpose dynamic 'instanceof' predicate.
11: */
12: public class IsInstanceOf implements UnaryPredicate {
13: private final Class<?> match;
14:
15: public IsInstanceOf(Class<?> match) {
16: this .match = match;
17: }
18:
19: public boolean execute(Object arg) {
20: return match.isAssignableFrom(arg.getClass());
21: }
22: }
|