You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2008/04/03 22:23:31 UTC
svn commit: r644470 [4/7] - in /commons/sandbox/functor/trunk/src:
main/java/org/apache/commons/functor/
main/java/org/apache/commons/functor/adapter/
main/java/org/apache/commons/functor/core/
main/java/org/apache/commons/functor/core/collection/ main...
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java Thu Apr 3 13:23:16 2008
@@ -22,18 +22,18 @@
/**
* Transposes (swaps) the arguments to some other
- * {@link BinaryFunction function}.
+ * {@link BinaryFunction function}.
* For example, given a function <i>f</i>
* and the ordered pair of arguments <i>a</i>,
* <i>b</i>.
- * {@link #evaluate evaluates} to
+ * {@link #evaluate evaluates} to
* <code>f.evaluate(b,a)</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link Serializable}, a given instance will
* only be truly <code>Serializable</code> if the
* underlying functor is. Attempts to serialize
- * an instance whose delegate is not
+ * an instance whose delegate is not
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -49,7 +49,7 @@
// functor interface
// ------------------------------------------------------------------------
- public Object evaluate(Object left, Object right) {
+ public Object evaluate(Object left, Object right) {
return function.evaluate(right,left);
}
@@ -60,11 +60,11 @@
return false;
}
}
-
+
public boolean equals(TransposedFunction that) {
return null != that && (null == function ? null == that.function : function.equals(that.function));
}
-
+
public int hashCode() {
int hash = "TransposedFunction".hashCode();
if(null != function) {
@@ -72,17 +72,17 @@
}
return hash;
}
-
+
public String toString() {
return "TransposedFunction<" + function + ">";
}
-
+
// static
// ------------------------------------------------------------------------
public static TransposedFunction transpose(BinaryFunction f) {
return null == f ? null : new TransposedFunction(f);
}
-
+
// attributes
// ------------------------------------------------------------------------
private BinaryFunction function = null;
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java Thu Apr 3 13:23:16 2008
@@ -22,18 +22,18 @@
/**
* Transposes (swaps) the arguments to some other
- * {@link BinaryPredicate predicate}.
+ * {@link BinaryPredicate predicate}.
* For example, given a predicate <i>p</i>
* and the ordered pair of arguments <i>a</i>,
* <i>b</i>.
- * {@link #test tests}
+ * {@link #test tests}
* <code>p.test(b,a)</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link Serializable}, a given instance will
* only be truly <code>Serializable</code> if the
* underlying functor is. Attempts to serialize
- * an instance whose delegate is not
+ * an instance whose delegate is not
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -49,7 +49,7 @@
// functor interface
// ------------------------------------------------------------------------
- public boolean test(Object left, Object right) {
+ public boolean test(Object left, Object right) {
return predicate.test(right,left);
}
@@ -60,11 +60,11 @@
return false;
}
}
-
+
public boolean equals(TransposedPredicate that) {
return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
-
+
public int hashCode() {
int hash = "TransposedPredicate".hashCode();
if(null != predicate) {
@@ -72,17 +72,17 @@
}
return hash;
}
-
+
public String toString() {
return "TransposedPredicate<" + predicate + ">";
}
-
+
// static
// ------------------------------------------------------------------------
public static TransposedPredicate transpose(BinaryPredicate p) {
return null == p ? null : new TransposedPredicate(p);
}
-
+
// attributes
// ------------------------------------------------------------------------
private BinaryPredicate predicate = null;
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java Thu Apr 3 13:23:16 2008
@@ -22,18 +22,18 @@
/**
* Transposes (swaps) the arguments to some other
- * {@link BinaryProcedure procedure}.
+ * {@link BinaryProcedure procedure}.
* For example, given a procedure <i>p</i>
* and the ordered pair of arguments <i>a</i>,
* <i>b</i>.
- * {@link #run runs}
+ * {@link #run runs}
* <code>p.run(b,a)</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link Serializable}, a given instance will
* only be truly <code>Serializable</code> if the
* underlying functor is. Attempts to serialize
- * an instance whose delegate is not
+ * an instance whose delegate is not
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -49,7 +49,7 @@
// functor interface
// ------------------------------------------------------------------------
- public void run(Object left, Object right) {
+ public void run(Object left, Object right) {
procedure.run(right,left);
}
@@ -60,11 +60,11 @@
return false;
}
}
-
+
public boolean equals(TransposedProcedure that) {
return null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure));
}
-
+
public int hashCode() {
int hash = "TransposedProcedure".hashCode();
if(null != procedure) {
@@ -72,17 +72,17 @@
}
return hash;
}
-
+
public String toString() {
return "TransposedProcedure<" + procedure + ">";
}
-
+
// static
// ------------------------------------------------------------------------
public static TransposedProcedure transpose(BinaryProcedure p) {
return null == p ? null : new TransposedProcedure(p);
}
-
+
// attributes
// ------------------------------------------------------------------------
private BinaryProcedure procedure = null;
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryAnd.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryAnd.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryAnd.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryAnd.java Thu Apr 3 13:23:16 2008
@@ -26,11 +26,11 @@
* Note that by this definition, the "and" of
* an empty collection of predicates tests <code>true</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link java.io.Serializable Serializable}, a given instance will
* only be truly <code>Serializable</code> if all the
* underlying functors are. Attempts to serialize
- * an instance whose delegates are not all
+ * an instance whose delegates are not all
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -55,14 +55,14 @@
public UnaryAnd(UnaryPredicate p, UnaryPredicate q, UnaryPredicate r) {
super(p,q,r);
}
-
+
// modifiers
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public UnaryAnd and(UnaryPredicate p) {
super.addUnaryPredicate(p);
return this;
}
-
+
// predicate interface
// ------------------------------------------------------------------------
public boolean test(Object obj) {
@@ -81,17 +81,17 @@
return false;
}
}
-
+
public boolean equals(UnaryAnd that) {
return getUnaryPredicateListEquals(that);
}
-
+
public int hashCode() {
return "UnaryAnd".hashCode() ^ getUnaryPredicateListHashCode();
}
-
+
public String toString() {
return "UnaryAnd<" + getUnaryPredicateListToString() + ">";
}
-
+
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java Thu Apr 3 13:23:16 2008
@@ -25,14 +25,14 @@
* A {@link BinaryFunction BinaryFunction} composed of
* one binary function, <i>f</i>, and two unary
* functions, <i>g</i> and <i>h</i>,
- * evaluating the ordered parameters <i>x</i>, <i>y</i>
+ * evaluating the ordered parameters <i>x</i>, <i>y</i>
* to <code><i>f</i>(<i>g</i>(<i>x</i>),<i>h</i>(<i>y</i>))</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link Serializable}, a given instance will
* only be truly <code>Serializable</code> if all the
* underlying functors are. Attempts to serialize
- * an instance whose delegates are not all
+ * an instance whose delegates are not all
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -45,7 +45,7 @@
public UnaryCompositeBinaryFunction(BinaryFunction f, UnaryFunction g, UnaryFunction h) {
binary = f;
leftUnary = g;
- rightUnary = h;
+ rightUnary = h;
}
// function interface
@@ -61,35 +61,35 @@
return false;
}
}
-
+
public boolean equals(UnaryCompositeBinaryFunction that) {
return (null != that) &&
(null == binary ? null == that.binary : binary.equals(that.binary)) &&
(null == leftUnary ? null == that.leftUnary : leftUnary.equals(that.leftUnary)) &&
(null == rightUnary ? null == that.rightUnary : rightUnary.equals(that.rightUnary));
}
-
+
public int hashCode() {
int hash = "UnaryCompositeBinaryFunction".hashCode();
if(null != binary) {
hash <<= 4;
- hash ^= binary.hashCode();
+ hash ^= binary.hashCode();
}
if(null != leftUnary) {
hash <<= 4;
- hash ^= leftUnary.hashCode();
+ hash ^= leftUnary.hashCode();
}
if(null != rightUnary) {
hash <<= 4;
- hash ^= rightUnary.hashCode();
+ hash ^= rightUnary.hashCode();
}
return hash;
}
-
+
public String toString() {
return "UnaryCompositeBinaryFunction<" + binary + ";" + leftUnary + ";" + rightUnary + ">";
}
-
+
// attributes
// ------------------------------------------------------------------------
private BinaryFunction binary = null;
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java Thu Apr 3 13:23:16 2008
@@ -25,14 +25,14 @@
* A {@link BinaryPredicate BinaryPredicate} composed of
* one binary predicate, <i>p</i>, and two unary
* functions, <i>f</i> and <i>g</i>,
- * evaluating the ordered parameters <i>x</i>, <i>y</i>
+ * evaluating the ordered parameters <i>x</i>, <i>y</i>
* to <code><i>p</i>(<i>f</i>(<i>x</i>),<i>g</i>(<i>y</i>))</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link Serializable}, a given instance will
* only be truly <code>Serializable</code> if all the
* underlying functors are. Attempts to serialize
- * an instance whose delegates are not all
+ * an instance whose delegates are not all
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -45,7 +45,7 @@
public UnaryCompositeBinaryPredicate(BinaryPredicate f, UnaryFunction g, UnaryFunction h) {
binary = f;
leftUnary = g;
- rightUnary = h;
+ rightUnary = h;
}
// function interface
@@ -61,35 +61,35 @@
return false;
}
}
-
+
public boolean equals(UnaryCompositeBinaryPredicate that) {
return (null != that) &&
(null == binary ? null == that.binary : binary.equals(that.binary)) &&
(null == leftUnary ? null == that.leftUnary : leftUnary.equals(that.leftUnary)) &&
(null == rightUnary ? null == that.rightUnary : rightUnary.equals(that.rightUnary));
}
-
+
public int hashCode() {
int hash = "UnaryCompositeBinaryPredicate".hashCode();
if(null != binary) {
hash <<= 4;
- hash ^= binary.hashCode();
+ hash ^= binary.hashCode();
}
if(null != leftUnary) {
hash <<= 4;
- hash ^= leftUnary.hashCode();
+ hash ^= leftUnary.hashCode();
}
if(null != rightUnary) {
hash <<= 4;
- hash ^= rightUnary.hashCode();
+ hash ^= rightUnary.hashCode();
}
return hash;
}
-
+
public String toString() {
return "UnaryCompositeBinaryPredicate<" + binary + ";" + leftUnary + ";" + rightUnary + ">";
}
-
+
// attributes
// ------------------------------------------------------------------------
private BinaryPredicate binary = null;
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java Thu Apr 3 13:23:16 2008
@@ -24,11 +24,11 @@
* {@link #test Tests} to the logical inverse
* of some other predicate.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link Serializable}, a given instance will
* only be truly <code>Serializable</code> if the
* underlying functor is. Attempts to serialize
- * an instance whose delegate is not
+ * an instance whose delegate is not
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -42,7 +42,7 @@
public UnaryNot(UnaryPredicate p) {
this.predicate = p;
}
-
+
// predicate interface
// ------------------------------------------------------------------------
public boolean test(Object obj) {
@@ -56,11 +56,11 @@
return false;
}
}
-
+
public boolean equals(UnaryNot that) {
return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
-
+
public int hashCode() {
int hash = "UnaryNot".hashCode();
if(null != predicate) {
@@ -68,7 +68,7 @@
}
return hash;
}
-
+
public String toString() {
return "UnaryNot<" + predicate + ">";
}
@@ -78,7 +78,7 @@
public static UnaryPredicate not(UnaryPredicate that) {
return null == that ? null : new UnaryNot(that);
}
-
+
// attributes
// ------------------------------------------------------------------------
private UnaryPredicate predicate = null;
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryOr.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryOr.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryOr.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryOr.java Thu Apr 3 13:23:16 2008
@@ -26,11 +26,11 @@
* Note that by this definition, the "or" of
* an empty collection of predicates tests <code>false</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link java.io.Serializable Serializable}, a given instance will
* only be truly <code>Serializable</code> if all the
* underlying functors are. Attempts to serialize
- * an instance whose delegates are not all
+ * an instance whose delegates are not all
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -55,14 +55,14 @@
public UnaryOr(UnaryPredicate p, UnaryPredicate q, UnaryPredicate r) {
super(p,q,r);
}
-
+
// modifiers
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public UnaryOr or(UnaryPredicate p) {
super.addUnaryPredicate(p);
return this;
}
-
+
// predicate interface
// ------------------------------------------------------------------------
public boolean test(Object a) {
@@ -81,17 +81,17 @@
return false;
}
}
-
+
public boolean equals(UnaryOr that) {
return getUnaryPredicateListEquals(that);
}
-
+
public int hashCode() {
return "UnaryOr".hashCode() ^ getUnaryPredicateListHashCode();
}
-
+
public String toString() {
return "UnaryOr<" + getUnaryPredicateListToString() + ">";
}
-
+
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnarySequence.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnarySequence.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnarySequence.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnarySequence.java Thu Apr 3 13:23:16 2008
@@ -24,17 +24,17 @@
import org.apache.commons.functor.UnaryProcedure;
/**
- * A {@link UnaryProcedure UnaryProcedure}
- * that {@link UnaryProcedure#run runs} an ordered
+ * A {@link UnaryProcedure UnaryProcedure}
+ * that {@link UnaryProcedure#run runs} an ordered
* sequence of {@link UnaryProcedure UnaryProcedures}.
* When the sequence is empty, this procedure is does
* nothing.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link Serializable}, a given instance will
* only be truly <code>Serializable</code> if all the
* underlying functors are. Attempts to serialize
- * an instance whose delegates are not all
+ * an instance whose delegates are not all
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
@@ -57,15 +57,15 @@
}
// modifiers
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public UnarySequence then(UnaryProcedure p) {
list.add(p);
return this;
}
-
+
// predicate interface
// ------------------------------------------------------------------------
- public void run(Object obj) {
+ public void run(Object obj) {
for(ListIterator iter = list.listIterator(list.size()); iter.hasPrevious();) {
((UnaryProcedure)iter.previous()).run(obj);
}
@@ -78,22 +78,22 @@
return false;
}
}
-
+
public boolean equals(UnarySequence that) {
// by construction, list is never null
return null != that && list.equals(that.list);
}
-
+
public int hashCode() {
// by construction, list is never null
return "UnarySequence".hashCode() ^ list.hashCode();
}
-
+
public String toString() {
return "UnarySequence<" + list + ">";
}
-
-
+
+
// attributes
// ------------------------------------------------------------------------
private List list = new ArrayList();
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/WhileDoProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/WhileDoProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/WhileDoProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/WhileDoProcedure.java Thu Apr 3 13:23:16 2008
@@ -21,15 +21,15 @@
/**
- * A {@link Procedure} implementation of a while loop. Given a {@link Predicate}
+ * A {@link Procedure} implementation of a while loop. Given a {@link Predicate}
* <i>c</i> and an {@link Procedure} <i>p</i>, {@link #run runs}
* <code>while(c.test()) { p.run(); }</code>.
* <p>
- * Note that although this class implements
+ * Note that although this class implements
* {@link java.io.Serializable}, a given instance will
* only be truly <code>Serializable</code> if all the
* underlying functors are. Attempts to serialize
- * an instance whose delegates are not all
+ * an instance whose delegates are not all
* <code>Serializable</code> will result in an exception.
* </p>
* @version $Revision$ $Date$
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/BaseGenerator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/BaseGenerator.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/BaseGenerator.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/BaseGenerator.java Thu Apr 3 13:23:16 2008
@@ -1,12 +1,12 @@
/*
* Copyright 2003-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -62,7 +62,7 @@
/** Stop the generator. Will stop the wrapped generator if one was set. */
public void stop() {
- if (wrappedGenerator != null) { wrappedGenerator.stop(); }
+ if (wrappedGenerator != null) { wrappedGenerator.stop(); }
stopped = true;
}
@@ -78,7 +78,7 @@
public final Generator apply(UnaryFunction func) {
return Algorithms.apply(this,func);
}
-
+
/** See {@link Algorithms#contains}. */
public final boolean contains(UnaryPredicate pred) {
return Algorithms.contains(this, pred);
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/Generator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/Generator.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/Generator.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/Generator.java Thu Apr 3 13:23:16 2008
@@ -1,12 +1,12 @@
/*
* Copyright 2003-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java Thu Apr 3 13:23:16 2008
@@ -1,12 +1,12 @@
/*
* Copyright 2003,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,7 +22,7 @@
/**
* Adapts an {@link Iterator} to the {@link Generator} interface.
- *
+ *
* @since 1.0
* @version $Revision$ $Date$
* @author Jason Horman (jason@jhorman.org)
@@ -47,7 +47,7 @@
public void run(UnaryProcedure proc) {
while(iter.hasNext()) {
proc.run(iter.next());
- if (isStopped()) { break; }
+ if (isStopped()) { break; }
}
}
@@ -59,14 +59,14 @@
return false;
}
}
-
+
public int hashCode() {
int hash = "IteratorToGeneratorAdapater".hashCode();
hash <<= 2;
hash ^= iter.hashCode();
- return hash;
+ return hash;
}
-
+
public String toString() {
return "IteratorToGeneratorAdapter<" + iter + ">";
}
@@ -78,7 +78,7 @@
public static IteratorToGeneratorAdapter adapt(Iterator iter) {
return null == iter ? null : new IteratorToGeneratorAdapter(iter);
}
-
+
// instance variables
//-----------------------------------------------------
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/CollectionTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/CollectionTransformer.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/CollectionTransformer.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/CollectionTransformer.java Thu Apr 3 13:23:16 2008
@@ -1,12 +1,12 @@
/*
* Copyright 2003,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/EachElement.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/EachElement.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/EachElement.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/EachElement.java Thu Apr 3 13:23:16 2008
@@ -1,12 +1,12 @@
/*
* Copyright 2003,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/IntegerRange.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/IntegerRange.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/IntegerRange.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/IntegerRange.java Thu Apr 3 13:23:16 2008
@@ -1,12 +1,12 @@
/*
* Copyright 2003,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,7 +40,7 @@
public IntegerRange(Number from, Number to, Number step) {
this(from.intValue(),to.intValue(),step.intValue());
}
-
+
public IntegerRange(int from, int to) {
this(from,to,defaultStep(from,to));
}
@@ -93,10 +93,10 @@
hash ^= step;
return hash;
}
-
+
// private methods
//---------------------------------------------------------------
-
+
private static int signOf(int value) {
if(value < 0) {
return -1;
@@ -117,7 +117,7 @@
// attributes
//---------------------------------------------------------------
-
+
private int from;
private int to;
private int step;
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/LongRange.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/LongRange.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/LongRange.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/LongRange.java Thu Apr 3 13:23:16 2008
@@ -1,12 +1,12 @@
/*
* Copyright 2003,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,7 +40,7 @@
public LongRange(Number from, Number to, Number step) {
this(from.longValue(),to.longValue(),step.longValue());
}
-
+
public LongRange(long from, long to) {
this(from,to,defaultStep(from,to));
}
@@ -93,10 +93,10 @@
hash ^= step;
return hash;
}
-
+
// private methods
//---------------------------------------------------------------
-
+
private static long signOf(long value) {
if(value < 0) {
return -1;
@@ -117,7 +117,7 @@
// attributes
//---------------------------------------------------------------
-
+
private long from;
private long to;
private long step;
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/BaseFunctorTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/BaseFunctorTest.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/BaseFunctorTest.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/BaseFunctorTest.java Thu Apr 3 13:23:16 2008
@@ -50,18 +50,18 @@
// Framework
// ------------------------------------------------------------------------
-
+
protected abstract Object makeFunctor() throws Exception;
-
+
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public final void testObjectEquals() throws Exception {
Object obj = makeFunctor();
assertEquals("equals must be reflexive",obj,obj);
assertEquals("hashCode must be reflexive",obj.hashCode(),obj.hashCode());
assertTrue(! obj.equals(null) ); // should be able to compare to null
-
+
Object obj2 = makeFunctor();
if(obj.equals(obj2)) {
assertEquals("equals implies hash equals",obj.hashCode(),obj2.hashCode());
@@ -78,7 +78,7 @@
ObjectOutputStream out = new ObjectOutputStream(buffer);
out.writeObject(obj);
out.close();
-
+
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
Object dest = in.readObject();
in.close();
@@ -100,17 +100,17 @@
public static void assertObjectsAreEqual(Object a, Object b) {
assertEquals(a,b);
assertEquals(b,a);
- assertEquals(a.hashCode(),b.hashCode());
+ assertEquals(a.hashCode(),b.hashCode());
assertEquals(a.toString(),b.toString()); // not strictly required
}
-
+
public static void assertObjectsAreNotEqual(Object a, Object b) {
assertTrue(!a.equals(b));
assertTrue(!b.equals(a));
assertTrue(a.hashCode() != b.hashCode()); // not strictly required
assertTrue(!a.toString().equals(b.toString())); // not strictly required
}
-
+
// private utils
// ------------------------------------------------------------------------
private String objectToString(Object obj) {
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAlgorithms.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAlgorithms.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAlgorithms.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAlgorithms.java Thu Apr 3 13:23:16 2008
@@ -92,7 +92,7 @@
assertNotNull(result);
assertEquals(list.size(),result.size());
assertEquals(list,result);
- }
+ }
public void testCollect2() {
Set set = new HashSet();
@@ -101,7 +101,7 @@
for(Iterator iter = list.iterator(); iter.hasNext(); ) {
assertTrue(set.contains(iter.next()));
}
- }
+ }
public void testCollect3() {
Set set = new HashSet();
@@ -110,7 +110,7 @@
for(Iterator iter = listWithDuplicates.iterator(); iter.hasNext(); ) {
assertTrue(set.contains(iter.next()));
}
- }
+ }
public void testDetect() {
assertEquals(new Integer(3),Algorithms.detect(list.iterator(),equalsThree));
@@ -120,42 +120,42 @@
} catch(NoSuchElementException e) {
// expected
}
- }
+ }
public void testDetectIfNone() {
assertEquals(new Integer(3),Algorithms.detect(list.iterator(),equalsThree,"Xyzzy"));
assertEquals("Xyzzy",Algorithms.detect(list.iterator(),equalsTwentyThree,"Xyzzy"));
- }
+ }
public void testForEach() {
Summer summer = new Summer();
Algorithms.foreach(list.iterator(),summer);
assertEquals(sum,summer.sum);
- }
+ }
public void testSelect1() {
Collection result = Algorithms.collect(Algorithms.select(list.iterator(),isEven));
assertNotNull(result);
assertEquals(evens,result);
- }
+ }
public void testSelect2() {
ArrayList result = new ArrayList();
assertSame(result,Algorithms.collect(Algorithms.select(list.iterator(),isEven),result));
assertEquals(evens,result);
- }
+ }
public void testReject1() {
Collection result = Algorithms.collect(Algorithms.reject(list.iterator(),isOdd));
assertNotNull(result);
assertEquals(evens,result);
- }
+ }
public void testReject2() {
ArrayList result = new ArrayList();
assertSame(result,Algorithms.collect(Algorithms.reject(list.iterator(),isOdd),result));
assertEquals(evens,result);
- }
+ }
public void testRetain() {
Algorithms.retain(list.iterator(),isEven);
@@ -187,9 +187,9 @@
public void testApplyToGenerator() {
Generator gen = new IntegerRange(1,5);
Summer summer = new Summer();
-
+
Algorithms.apply(gen,new Doubler()).run(summer);
-
+
assertEquals(2*(1+2+3+4),summer.sum);
}
@@ -239,35 +239,35 @@
assertEquals("[0, 1]", col.toString());
}
- public void testDoUntil() {
+ public void testDoUntil() {
for(int i=0;i<3;i++){
Counter counter = new Counter();
Algorithms.dountil(counter,new Offset(i));
- assertEquals(i+1,counter.count);
+ assertEquals(i+1,counter.count);
}
}
-
- public void testDoWhile() {
+
+ public void testDoWhile() {
for(int i=0;i<3;i++){
Counter counter = new Counter();
Algorithms.dowhile(counter,new Limit(i));
- assertEquals(i+1,counter.count);
+ assertEquals(i+1,counter.count);
}
}
-
- public void testUntilDo() {
+
+ public void testUntilDo() {
for(int i=0;i<3;i++){
Counter counter = new Counter();
Algorithms.untildo(new Offset(i),counter);
- assertEquals(i,counter.count);
+ assertEquals(i,counter.count);
}
}
-
- public void testWhileDo() {
+
+ public void testWhileDo() {
for(int i=0;i<3;i++){
Counter counter = new Counter();
Algorithms.whiledo(new Limit(i),counter);
- assertEquals(i,counter.count);
+ assertEquals(i,counter.count);
}
}
public void testRecurse() {
@@ -334,14 +334,14 @@
}
public int count = 0;
}
-
+
static class Summer implements UnaryProcedure {
public void run(Object that) {
sum += ((Number)that).intValue();
}
public int sum = 0;
}
-
+
static class Doubler implements UnaryFunction {
public Object evaluate(Object obj) {
return new Integer(2*((Number)obj).intValue());
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAll.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAll.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAll.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/TestAll.java Thu Apr 3 13:23:16 2008
@@ -34,13 +34,13 @@
// functor package
suite.addTest(TestAlgorithms.suite());
-
+
// sub-packages
suite.addTest(org.apache.commons.functor.adapter.TestAll.suite());
suite.addTest(org.apache.commons.functor.core.TestAll.suite());
suite.addTest(org.apache.commons.functor.generator.TestAll.suite());
suite.addTest(org.apache.commons.functor.example.TestAll.suite());
-
+
return suite;
}
}
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestAll.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestAll.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestAll.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestAll.java Thu Apr 3 13:23:16 2008
@@ -31,11 +31,11 @@
public static Test suite() {
TestSuite suite = new TestSuite();
-
+
suite.addTest(TestFunctionProcedure.suite());
suite.addTest(TestUnaryFunctionUnaryProcedure.suite());
suite.addTest(TestBinaryFunctionBinaryProcedure.suite());
-
+
suite.addTest(TestProcedureFunction.suite());
suite.addTest(TestUnaryProcedureUnaryFunction.suite());
suite.addTest(TestBinaryProcedureBinaryFunction.suite());
@@ -51,19 +51,19 @@
suite.addTest(TestFunctionUnaryFunction.suite());
suite.addTest(TestIgnoreRightFunction.suite());
suite.addTest(TestIgnoreLeftFunction.suite());
-
+
suite.addTest(TestPredicateUnaryPredicate.suite());
suite.addTest(TestIgnoreRightPredicate.suite());
suite.addTest(TestIgnoreLeftPredicate.suite());
-
+
suite.addTest(TestProcedureUnaryProcedure.suite());
suite.addTest(TestIgnoreRightProcedure.suite());
suite.addTest(TestIgnoreLeftProcedure.suite());
-
+
suite.addTest(TestBoundFunction.suite());
suite.addTest(TestLeftBoundFunction.suite());
suite.addTest(TestRightBoundFunction.suite());
-
+
suite.addTest(TestBoundPredicate.suite());
suite.addTest(TestLeftBoundPredicate.suite());
suite.addTest(TestRightBoundPredicate.suite());
@@ -71,7 +71,7 @@
suite.addTest(TestBoundProcedure.suite());
suite.addTest(TestLeftBoundProcedure.suite());
suite.addTest(TestRightBoundProcedure.suite());
-
+
return suite;
}
}
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryPredicate.java Thu Apr 3 13:23:16 2008
@@ -59,13 +59,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTestWhenTrue() throws Exception {
BinaryPredicate p = new BinaryFunctionBinaryPredicate(new Constant(Boolean.TRUE));
assertTrue(p.test(null,null));
}
-
+
public void testTestWhenFalse() throws Exception {
BinaryPredicate p = new BinaryFunctionBinaryPredicate(new Constant(Boolean.FALSE));
assertTrue(!p.test(null,null));
@@ -80,7 +80,7 @@
// expected
}
}
-
+
public void testTestWhenNonBoolean() throws Exception {
BinaryPredicate p = new BinaryFunctionBinaryPredicate(new Constant(new Integer(2)));
try {
@@ -90,7 +90,7 @@
// expected
}
}
-
+
public void testEquals() throws Exception {
BinaryPredicate p = new BinaryFunctionBinaryPredicate(new Constant(Boolean.TRUE));
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryProcedure.java Thu Apr 3 13:23:16 2008
@@ -61,7 +61,7 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testRun() throws Exception {
class EvaluateCounter implements BinaryFunction {
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java Thu Apr 3 13:23:16 2008
@@ -59,13 +59,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTestWhenTrue() throws Exception {
BinaryFunction f = new BinaryPredicateBinaryFunction(new Constant(true));
assertEquals(Boolean.TRUE,f.evaluate(null,null));
}
-
+
public void testTestWhenFalse() throws Exception {
BinaryFunction f = new BinaryPredicateBinaryFunction(new Constant(false));
assertEquals(Boolean.FALSE,f.evaluate(null,null));
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryProcedureBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryProcedureBinaryFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryProcedureBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryProcedureBinaryFunction.java Thu Apr 3 13:23:16 2008
@@ -61,13 +61,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
BinaryFunction f = new BinaryProcedureBinaryFunction(new NoOp());
assertNull(f.evaluate(null,null));
}
-
+
public void testEquals() throws Exception {
BinaryFunction f = new BinaryProcedureBinaryFunction(new NoOp());
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundFunction.java Thu Apr 3 13:23:16 2008
@@ -60,13 +60,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
Function f = new BoundFunction(new Identity(),"xyzzy");
assertEquals("xyzzy",f.evaluate());
}
-
+
public void testEquals() throws Exception {
Function f = new BoundFunction(new Identity(),"xyzzy");
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java Thu Apr 3 13:23:16 2008
@@ -60,7 +60,7 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTest() throws Exception {
{
@@ -72,7 +72,7 @@
assertEquals(false,p.test());
}
}
-
+
public void testEquals() throws Exception {
Predicate f = new BoundPredicate(new Constant(true),"xyzzy");
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundProcedure.java Thu Apr 3 13:23:16 2008
@@ -60,13 +60,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testRun() throws Exception {
Procedure p = new BoundProcedure(new UnaryFunctionUnaryProcedure(new Identity()),Boolean.TRUE);
p.run();
}
-
+
public void testEquals() throws Exception {
Procedure f = new BoundProcedure(new NoOp(),"xyzzy");
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionPredicate.java Thu Apr 3 13:23:16 2008
@@ -59,13 +59,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTestWhenTrue() throws Exception {
Predicate p = new FunctionPredicate(new Constant(Boolean.TRUE));
assertTrue(p.test());
}
-
+
public void testTestWhenFalse() throws Exception {
Predicate p = new FunctionPredicate(new Constant(Boolean.FALSE));
assertTrue(!p.test());
@@ -80,7 +80,7 @@
// expected
}
}
-
+
public void testTestWhenNonBoolean() throws Exception {
Predicate p = new FunctionPredicate(new Constant(new Integer(2)));
try {
@@ -90,7 +90,7 @@
// expected
}
}
-
+
public void testEquals() throws Exception {
Predicate p = new FunctionPredicate(new Constant(Boolean.TRUE));
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionProcedure.java Thu Apr 3 13:23:16 2008
@@ -61,7 +61,7 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testRun() throws Exception {
class EvaluateCounter implements Function {
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionUnaryFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFunctionUnaryFunction.java Thu Apr 3 13:23:16 2008
@@ -59,14 +59,14 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
UnaryFunction f = new FunctionUnaryFunction(new Constant("xyzzy"));
assertEquals("xyzzy",f.evaluate(null));
assertEquals("xyzzy",f.evaluate("abc"));
}
-
+
public void testEquals() throws Exception {
UnaryFunction f = new FunctionUnaryFunction(new Constant("xyzzy"));
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftFunction.java Thu Apr 3 13:23:16 2008
@@ -60,7 +60,7 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
BinaryFunction f = new IgnoreLeftFunction(new Identity());
@@ -69,7 +69,7 @@
assertEquals("xyzzy",f.evaluate(null,"xyzzy"));
assertEquals("xyzzy",f.evaluate("abc","xyzzy"));
}
-
+
public void testEquals() throws Exception {
BinaryFunction f = new IgnoreLeftFunction(new Constant("xyzzy"));
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftPredicate.java Thu Apr 3 13:23:16 2008
@@ -60,14 +60,14 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
BinaryPredicate p = new IgnoreLeftPredicate(new UnaryFunctionUnaryPredicate(new Identity()));
assertTrue(p.test(null,Boolean.TRUE));
assertTrue(!p.test(null,Boolean.FALSE));
}
-
+
public void testEquals() throws Exception {
BinaryPredicate p = new IgnoreLeftPredicate(new UnaryFunctionUnaryPredicate(new Identity()));
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreLeftProcedure.java Thu Apr 3 13:23:16 2008
@@ -60,13 +60,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
BinaryProcedure p = new IgnoreLeftProcedure(new UnaryFunctionUnaryProcedure(new Identity()));
p.run(null,Boolean.TRUE);
}
-
+
public void testEquals() throws Exception {
BinaryProcedure p = new IgnoreLeftProcedure(new NoOp());
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightFunction.java Thu Apr 3 13:23:16 2008
@@ -60,7 +60,7 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
BinaryFunction f = new IgnoreRightFunction(new Identity());
@@ -69,7 +69,7 @@
assertEquals("xyzzy",f.evaluate("xyzzy",null));
assertEquals("xyzzy",f.evaluate("xyzzy","abc"));
}
-
+
public void testEquals() throws Exception {
BinaryFunction f = new IgnoreRightFunction(new Constant("xyzzy"));
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightPredicate.java Thu Apr 3 13:23:16 2008
@@ -60,14 +60,14 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
BinaryPredicate p = new IgnoreRightPredicate(new UnaryFunctionUnaryPredicate(new Identity()));
assertTrue(p.test(Boolean.TRUE,null));
assertTrue(!p.test(Boolean.FALSE,null));
}
-
+
public void testEquals() throws Exception {
BinaryPredicate p = new IgnoreRightPredicate(new UnaryFunctionUnaryPredicate(new Identity()));
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestIgnoreRightProcedure.java Thu Apr 3 13:23:16 2008
@@ -60,13 +60,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
BinaryProcedure p = new IgnoreRightProcedure(new UnaryFunctionUnaryProcedure(new Identity()));
p.run(Boolean.TRUE,null);
}
-
+
public void testEquals() throws Exception {
BinaryProcedure p = new IgnoreRightProcedure(new NoOp());
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundFunction.java Thu Apr 3 13:23:16 2008
@@ -61,13 +61,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
UnaryFunction f = new LeftBoundFunction(new RightIdentity(),"foo");
assertEquals("xyzzy",f.evaluate("xyzzy"));
}
-
+
public void testEquals() throws Exception {
UnaryFunction f = new LeftBoundFunction(new RightIdentity(),"xyzzy");
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundPredicate.java Thu Apr 3 13:23:16 2008
@@ -60,14 +60,14 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTest() throws Exception {
UnaryPredicate p = new LeftBoundPredicate(new BinaryFunctionBinaryPredicate(new RightIdentity()),"foo");
assertEquals(true,p.test(Boolean.TRUE));
assertEquals(false,p.test(Boolean.FALSE));
}
-
+
public void testEquals() throws Exception {
UnaryPredicate p = new LeftBoundPredicate(new Constant(true),"xyzzy");
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestLeftBoundProcedure.java Thu Apr 3 13:23:16 2008
@@ -60,19 +60,19 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testRun() throws Exception {
UnaryProcedure p = new LeftBoundProcedure(new BinaryFunctionBinaryProcedure(new RightIdentity()),"foo");
p.run(Boolean.TRUE);
p.run(Boolean.FALSE);
}
-
+
public void testEquals() throws Exception {
UnaryProcedure f = new LeftBoundProcedure(new NoOp(),"xyzzy");
assertEquals(f,f);
assertObjectsAreEqual(f,new LeftBoundProcedure(new NoOp(),"xyzzy"));
- assertObjectsAreNotEqual(f,new NoOp());
+ assertObjectsAreNotEqual(f,new NoOp());
assertObjectsAreNotEqual(f,new LeftBoundProcedure(new BinaryFunctionBinaryProcedure(new RightIdentity()),"xyzzy"));
assertObjectsAreNotEqual(f,new LeftBoundProcedure(new NoOp(),"foo"));
assertObjectsAreNotEqual(f,new LeftBoundProcedure(null,"xyzzy"));
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java Thu Apr 3 13:23:16 2008
@@ -59,13 +59,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTestWhenTrue() throws Exception {
Function f = new PredicateFunction(new Constant(true));
assertEquals(Boolean.TRUE,f.evaluate());
}
-
+
public void testTestWhenFalse() throws Exception {
Function f = new PredicateFunction(new Constant(false));
assertEquals(Boolean.FALSE,f.evaluate());
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateUnaryPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateUnaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateUnaryPredicate.java Thu Apr 3 13:23:16 2008
@@ -59,13 +59,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
UnaryPredicate p = new PredicateUnaryPredicate(new Constant(true));
assertTrue(p.test(null));
}
-
+
public void testEquals() throws Exception {
UnaryPredicate p = new PredicateUnaryPredicate(new Constant(true));
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureFunction.java Thu Apr 3 13:23:16 2008
@@ -61,13 +61,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
Function f = new ProcedureFunction(new NoOp());
assertNull(f.evaluate());
}
-
+
public void testEquals() throws Exception {
Function f = new ProcedureFunction(new NoOp());
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java Thu Apr 3 13:23:16 2008
@@ -60,13 +60,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
UnaryProcedure p = new ProcedureUnaryProcedure(new FunctionProcedure(new Constant(null)));
p.run(Boolean.TRUE);
}
-
+
public void testEquals() throws Exception {
UnaryProcedure p = new ProcedureUnaryProcedure(new NoOp());
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java Thu Apr 3 13:23:16 2008
@@ -61,13 +61,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
UnaryFunction f = new RightBoundFunction(new LeftIdentity(),"foo");
assertEquals("xyzzy",f.evaluate("xyzzy"));
}
-
+
public void testEquals() throws Exception {
UnaryFunction f = new RightBoundFunction(new LeftIdentity(),"xyzzy");
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java Thu Apr 3 13:23:16 2008
@@ -60,14 +60,14 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTest() throws Exception {
UnaryPredicate f = new RightBoundPredicate(new BinaryFunctionBinaryPredicate(new LeftIdentity()),"foo");
assertEquals(true,f.test(Boolean.TRUE));
assertEquals(false,f.test(Boolean.FALSE));
}
-
+
public void testEquals() throws Exception {
UnaryPredicate f = new RightBoundPredicate(new Constant(true),"xyzzy");
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java Thu Apr 3 13:23:16 2008
@@ -60,14 +60,14 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testRun() throws Exception {
UnaryProcedure p = new RightBoundProcedure(new BinaryFunctionBinaryProcedure(new LeftIdentity()),"foo");
p.run(Boolean.TRUE);
p.run(Boolean.FALSE);
}
-
+
public void testEquals() throws Exception {
UnaryProcedure f = new RightBoundProcedure(new NoOp(),"xyzzy");
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java Thu Apr 3 13:23:16 2008
@@ -59,13 +59,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTestWhenTrue() throws Exception {
UnaryPredicate p = new UnaryFunctionUnaryPredicate(new Constant(Boolean.TRUE));
assertTrue(p.test(null));
}
-
+
public void testTestWhenFalse() throws Exception {
UnaryPredicate p = new UnaryFunctionUnaryPredicate(new Constant(Boolean.FALSE));
assertTrue(!p.test(null));
@@ -80,7 +80,7 @@
// expected
}
}
-
+
public void testTestWhenNonBoolean() throws Exception {
UnaryPredicate p = new UnaryFunctionUnaryPredicate(new Constant(new Integer(2)));
try {
@@ -90,7 +90,7 @@
// expected
}
}
-
+
public void testEquals() throws Exception {
UnaryPredicate p = new UnaryFunctionUnaryPredicate(new Constant(Boolean.TRUE));
assertEquals(p,p);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java Thu Apr 3 13:23:16 2008
@@ -61,7 +61,7 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testRun() throws Exception {
class EvaluateCounter implements UnaryFunction {
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java Thu Apr 3 13:23:16 2008
@@ -59,13 +59,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testTestWhenTrue() throws Exception {
UnaryFunction f = new UnaryPredicateUnaryFunction(new Constant(true));
assertEquals(Boolean.TRUE,f.evaluate(null));
}
-
+
public void testTestWhenFalse() throws Exception {
UnaryFunction f = new UnaryPredicateUnaryFunction(new Constant(false));
assertEquals(Boolean.FALSE,f.evaluate(null));
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java Thu Apr 3 13:23:16 2008
@@ -61,13 +61,13 @@
}
// Tests
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
public void testEvaluate() throws Exception {
UnaryFunction f = new UnaryProcedureUnaryFunction(new NoOp());
assertNull(f.evaluate(null));
}
-
+
public void testEquals() throws Exception {
UnaryFunction f = new UnaryProcedureUnaryFunction(new NoOp());
assertEquals(f,f);
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestAll.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestAll.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestAll.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestAll.java Thu Apr 3 13:23:16 2008
@@ -31,7 +31,7 @@
public static Test suite() {
TestSuite suite = new TestSuite();
-
+
suite.addTest(TestNoOp.suite());
suite.addTest(TestConstant.suite());
suite.addTest(TestIdentity.suite());
@@ -50,7 +50,7 @@
suite.addTest(org.apache.commons.functor.core.composite.TestAll.suite());
suite.addTest(org.apache.commons.functor.core.collection.TestAll.suite());
suite.addTest(org.apache.commons.functor.core.comparator.TestAll.suite());
-
+
return suite;
}
}
Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java?rev=644470&r1=644469&r2=644470&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java (original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java Thu Apr 3 13:23:16 2008
@@ -58,7 +58,7 @@
// Tests
// ------------------------------------------------------------------------
-
+
public void testEvaluate() throws Exception {
Constant f = new Constant("xyzzy");
assertEquals("xyzzy",f.evaluate());
@@ -68,7 +68,7 @@
assertEquals("xyzzy",f.evaluate("foo"));
assertEquals("xyzzy",f.evaluate("foo",new Integer(2)));
}
-
+
public void testEvaluateConstantNull() throws Exception {
Constant f = new Constant(null);
assertNull(f.evaluate());
@@ -89,7 +89,7 @@
assertTrue(truePred.test("foo"));
assertTrue(truePred.test("foo",new Integer(2)));
}
-
+
public void testConstantFalse() throws Exception {
Constant falsePred = new Constant(false);
assertTrue(!falsePred.test());
@@ -100,7 +100,7 @@
assertTrue(!falsePred.test("foo"));
assertTrue(!falsePred.test("foo",new Integer(2)));
}
-
+
public void testEquals() throws Exception {
Constant f = new Constant("xyzzy");
assertEquals(f,f);
@@ -109,7 +109,7 @@
assertObjectsAreNotEqual(f,new Constant("abcde"));
assertObjectsAreNotEqual(f,new Constant(null));
}
-
+
public void testConstants() throws Exception {
assertEquals(Constant.predicate(true),Constant.instance(Boolean.TRUE));
@@ -125,6 +125,6 @@
assertEquals(Constant.predicate(false),Constant.falsePredicate());
assertSame(Constant.predicate(false),Constant.falsePredicate());
}
-
-
+
+
}