From: Nat P. <np...@us...> - 2002-10-21 17:29:03
|
Update of /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock In directory usw-pr-cvs1:/tmp/cvs-serv2155/source/com/b13media/mock Modified Files: Or.java P.java IsInstanceOf.java Matches.java Predicate.java And.java IsAnything.java IsNot.java IsEventFrom.java IsSame.java Log Message: Fixed erroneous javadoc comments caused by overenthusiastic use of copy-and-paste. Index: Or.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/Or.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Or.java 22 May 2002 10:02:53 -0000 1.1.1.1 +++ Or.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -4,15 +4,13 @@ */ package com.b13media.mock; -/** +/** Calculates the logical disjunction of two predicates. */ public class Or implements Predicate { Predicate _p1, _p2; - /** Creates a new instance of Or - */ public Or( Predicate p1, Predicate p2 ) { _p1 = p1; _p2 = p2; @@ -27,6 +25,6 @@ } public String toString() { - return "(" + _p1.toString() + ") or (" + _p2.toString() + ")"; + return "(" + _p1.toString() + " or " + _p2.toString() + ")"; } } Index: P.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/P.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- P.java 20 Oct 2002 23:20:35 -0000 1.2 +++ P.java 21 Oct 2002 17:28:58 -0000 1.3 @@ -84,9 +84,9 @@ return new IsInstanceOf(c); } - /** - * Helper methods for succinctly constructing Predicate arrays + /* Helper methods for succinctly constructing Predicate arrays */ + public static Predicate[] arg(Predicate p) { return new Predicate[] {p}; } Index: IsInstanceOf.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/IsInstanceOf.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- IsInstanceOf.java 22 May 2002 10:02:49 -0000 1.1.1.1 +++ IsInstanceOf.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -5,15 +5,18 @@ package com.b13media.mock; -/** Is the argument equal to another value, as tested by the - * {@link java.lang.Object#equals} method? +/** Tests whether the argument is an instance of a class. */ public class IsInstanceOf implements Predicate { private Class _class; - /** Creates a new instance of IsEqual - */ + /** Creates a new instance of IsInstanceOf + * + * @param theclass + * The predicate evaluates to true for instances of this class + * or one of its subclasses. + */ public IsInstanceOf( Class theclass ) { _class = theclass; } Index: Matches.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/Matches.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Matches.java 11 Oct 2002 14:57:36 -0000 1.1 +++ Matches.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -8,8 +8,7 @@ import java.util.regex.Pattern; -/** Is the argument equal to another value, as tested by the - * {@link java.lang.Object#equals} method? +/** Is the argument a string that matches a regular expression? */ public class Matches implements Predicate { Index: Predicate.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/Predicate.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Predicate.java 22 May 2002 10:02:58 -0000 1.1.1.1 +++ Predicate.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -8,5 +8,7 @@ */ public interface Predicate { + /** Evaluates the predicate on argument <var>o</var>. + */ boolean eval( Object o ); } Index: And.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/And.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- And.java 22 May 2002 10:02:49 -0000 1.1.1.1 +++ And.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -4,15 +4,13 @@ */ package com.b13media.mock; -/** +/** Calculates the logical conjunction of two predicates. */ public class And implements Predicate { Predicate _p1, _p2; - /** Creates a new instance of And - */ public And(Predicate p1, Predicate p2) { _p1 = p1; _p2 = p2; @@ -27,6 +25,6 @@ } public String toString() { - return "(" + _p1.toString() + ") and (" + _p2.toString() + ")"; + return "(" + _p1.toString() + " and " + _p2.toString() + ")"; } } Index: IsAnything.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/IsAnything.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- IsAnything.java 22 May 2002 10:02:49 -0000 1.1.1.1 +++ IsAnything.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -5,12 +5,10 @@ package com.b13media.mock; -/** Is the argument null? +/** A predicate that always returns <code>true</code>. */ public class IsAnything implements Predicate { - /** Creates a new instance of IsAnything - */ public IsAnything() { } Index: IsNot.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/IsNot.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- IsNot.java 22 May 2002 10:02:53 -0000 1.1.1.1 +++ IsNot.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -5,15 +5,12 @@ package com.b13media.mock; -/** Is the argument equal to another value, as tested by the - * {@link java.lang.Object#equals} method? +/** Calculates the logical negation of a predicate. */ public class IsNot implements Predicate { private Predicate _predicate; - /** Creates a new instance of IsNot - */ public IsNot( Predicate p ) { _predicate = p; } Index: IsEventFrom.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/IsEventFrom.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- IsEventFrom.java 14 Oct 2002 18:01:18 -0000 1.2 +++ IsEventFrom.java 21 Oct 2002 17:28:58 -0000 1.3 @@ -6,16 +6,26 @@ import java.util.EventObject; +/** Tests if the argument is an event announced by a specific object. + */ public class IsEventFrom implements Predicate { private Class _event_class; private Object _source; + /** Constructs an IsEventFrom predicate that returns true for any object + * derived from {@link java.util.EventObject} announced by + * <var>source</var>. + */ public IsEventFrom( Object source ) { this( EventObject.class, source ); } + /** Constructs an IsEventFrom predicate that returns true for any object + * derived from <var>event_class</var> announced by + * <var>source</var>. + */ public IsEventFrom( Class event_class, Object source ) { _event_class = event_class; _source = source; Index: IsSame.java =================================================================== RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/IsSame.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- IsSame.java 22 May 2002 10:02:53 -0000 1.1.1.1 +++ IsSame.java 21 Oct 2002 17:28:58 -0000 1.2 @@ -12,7 +12,11 @@ private Object _object; /** Creates a new instance of IsSame - */ + * + * @param o + * The predicate evaluates to true only when the argument is + * this object. + */ public IsSame(Object o) { _object = o; } |