Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mockobjects.constraint
Class IsEventFrom  view IsEventFrom download IsEventFrom.java

java.lang.Object
  extended bycom.mockobjects.constraint.IsEventFrom
All Implemented Interfaces:
Constraint

public class IsEventFrom
extends java.lang.Object
implements Constraint

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


Field Summary
private  java.lang.Class _event_class
           
private  java.lang.Object _source
           
 
Constructor Summary
IsEventFrom(java.lang.Class event_class, java.lang.Object source)
          Constructs an IsEventFrom predicate that returns true for any object derived from event_class announced by source.
IsEventFrom(java.lang.Object source)
          Constructs an IsEventFrom predicate that returns true for any object derived from java.util.EventObject announced by source.
 
Method Summary
 boolean eval(java.lang.Object o)
          Evaluates the constraint for argument o.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_event_class

private java.lang.Class _event_class

_source

private java.lang.Object _source
Constructor Detail

IsEventFrom

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


IsEventFrom

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

Method Detail

eval

public boolean eval(java.lang.Object o)
Description copied from interface: Constraint
Evaluates the constraint for argument o.

Specified by:
eval in interface Constraint

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).