edu.ucsb.ccs.jaqual.standard
Class InstanceOf

java.lang.Object
  |
  +--edu.ucsb.ccs.jaqual.standard.InstanceOf
All Implemented Interfaces:
Assertion

public class InstanceOf
extends java.lang.Object
implements Assertion

Assertion to check if an object is an instance of a certain class type.

Example use:

   ForAll.in(elements).ensure(new InstanceOf(Integer.class));
 

Version:
$Id: InstanceOf.java,v 1.2 2002/07/11 19:58:33 parkera Exp $
Author:
Parker Abercrombie

Constructor Summary
InstanceOf(java.lang.Class clazz)
          Create a new assertion.
 
Method Summary
 boolean eval(java.lang.Object o)
          Test an object to see if it is an instance of the target class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstanceOf

public InstanceOf(java.lang.Class clazz)
Create a new assertion.

Parameters:
clazz - the cass to match instances of.
Method Detail

eval

public boolean eval(java.lang.Object o)
Test an object to see if it is an instance of the target class.

Specified by:
eval in interface Assertion
Parameters:
o - the object to test.
Returns:
true if `o' is an instance of the target class. False if `o' is null, or not an instance.