wyvern.lib.predicates
Class SameClassPredicate

java.lang.Object
  extended bywyvern.lib.predicates.SameClassPredicate
All Implemented Interfaces:
Predicate

public class SameClassPredicate
extends java.lang.Object
implements Predicate

This predicate tests to see if an object is of the specified class.

Version:
1.0, Nov 19, 1997
Author:
Steve Yegge

Constructor Summary
SameClassPredicate(java.lang.Class c)
          Saves the predicate class.
SameClassPredicate(java.lang.Class[] classes)
          Constructs a new SameClassPredicate for an array of classes.
 
Method Summary
 boolean predicate(GameObject obj)
          Return true if the passed object is of the same class as the predicate class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SameClassPredicate

public SameClassPredicate(java.lang.Class c)
Saves the predicate class.


SameClassPredicate

public SameClassPredicate(java.lang.Class[] classes)
Constructs a new SameClassPredicate for an array of classes.

Parameters:
classes - an array of classes for which to return 'true'.
Method Detail

predicate

public boolean predicate(GameObject obj)
Return true if the passed object is of the same class as the predicate class.

Specified by:
predicate in interface Predicate
Parameters:
obj - any GameObject
Returns:
true if the object passes, else false