com.mockobjects.constraint

Class IsEventFrom

Implemented Interfaces:
Constraint

public class IsEventFrom
extends java.lang.Object
implements Constraint

Tests if the value is an event announced by a specific object.

Constructor Summary

IsEventFrom(Class event_class, Object source)
Constructs an IsEventFrom predicate that returns true for any object derived from event_class announced by source.
IsEventFrom(Object source)
Constructs an IsEventFrom predicate that returns true for any object derived from java.util.EventObject announced by source.

Method Summary

boolean
eval(Object o)
Evaluates the constraint for argument o.
String
toString()

Constructor Details

IsEventFrom

public IsEventFrom(Class event_class,
                   Object source)
Constructs an IsEventFrom predicate that returns true for any object derived from event_class announced by source.

IsEventFrom

public IsEventFrom(Object source)
Constructs an IsEventFrom predicate that returns true for any object derived from java.util.EventObject announced by source.

Method Details

eval

public boolean eval(Object o)
Evaluates the constraint for argument o.
Specified by:
eval in interface Constraint
Returns:
true if o meets the constraint, false if it does not.

toString

public String toString()

Copyright © 2002 Mock Objects. All Rights Reserved.