commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwaldh...@apache.org
Subject cvs commit: jakarta-commons-sandbox/functor/src/java/org/apache/commons/functor/core ConstantPredicate.java
Date Mon, 24 Nov 2003 20:31:20 GMT
rwaldhoff    2003/11/24 12:31:20

  Modified:    functor/src/test/org/apache/commons/functor/adapter
                        TestBinaryFunctionBinaryPredicate.java
                        TestFunctionPredicate.java
                        TestUnaryFunctionUnaryPredicate.java
               functor/src/test/org/apache/commons/functor/core
                        TestIsInstanceOf.java TestIsNotEqual.java
                        TestIsNotNull.java TestConstantPredicate.java
                        TestIsNull.java TestIsEqual.java
               functor/src/test/org/apache/commons/functor/core/collection
                        TestIsElementOf.java TestPredicatedIterator.java
               functor/src/test/org/apache/commons/functor/core/composite
                        TestBinaryNot.java TestTransposedPredicate.java
                        TestOr.java TestNot.java TestUnaryOr.java
                        TestUnaryAnd.java TestAnd.java TestBinaryAnd.java
                        TestUnaryNot.java TestBinaryOr.java
               functor/src/java/org/apache/commons/functor/core
                        ConstantPredicate.java
  Log:
  rename ConstantPredicate static methods
  
  Revision  Changes    Path
  1.3       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryPredicate.java
  
  Index: TestBinaryFunctionBinaryPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/adapter/TestBinaryFunctionBinaryPredicate.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestBinaryFunctionBinaryPredicate.java	28 Jan 2003 12:00:30 -0000	1.2
  +++ TestBinaryFunctionBinaryPredicate.java	24 Nov 2003 20:31:19 -0000	1.3
  @@ -136,7 +136,7 @@
           BinaryPredicate p = new BinaryFunctionBinaryPredicate(new ConstantFunction(Boolean.TRUE));
           assertEquals(p,p);
           assertObjectsAreEqual(p,new BinaryFunctionBinaryPredicate(new ConstantFunction(Boolean.TRUE)));
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
           assertObjectsAreNotEqual(p,new BinaryFunctionBinaryPredicate(null));
           assertObjectsAreNotEqual(p,new BinaryFunctionBinaryPredicate(new ConstantFunction(Boolean.FALSE)));
           assertObjectsAreEqual(new BinaryFunctionBinaryPredicate(null),new BinaryFunctionBinaryPredicate(null));
  
  
  
  1.2       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/adapter/TestFunctionPredicate.java
  
  Index: TestFunctionPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/adapter/TestFunctionPredicate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestFunctionPredicate.java	27 Jan 2003 19:33:41 -0000	1.1
  +++ TestFunctionPredicate.java	24 Nov 2003 20:31:19 -0000	1.2
  @@ -136,7 +136,7 @@
           Predicate p = new FunctionPredicate(new ConstantFunction(Boolean.TRUE));
           assertEquals(p,p);
           assertObjectsAreEqual(p,new FunctionPredicate(new ConstantFunction(Boolean.TRUE)));
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
           assertObjectsAreNotEqual(p,new FunctionPredicate(null));
           assertObjectsAreNotEqual(p,new FunctionPredicate(new ConstantFunction(Boolean.FALSE)));
           assertObjectsAreEqual(new FunctionPredicate(null),new FunctionPredicate(null));
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java
  
  Index: TestUnaryFunctionUnaryPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestUnaryFunctionUnaryPredicate.java	28 Jan 2003 12:00:30 -0000	1.2
  +++ TestUnaryFunctionUnaryPredicate.java	24 Nov 2003 20:31:19 -0000	1.3
  @@ -136,7 +136,7 @@
           UnaryPredicate p = new UnaryFunctionUnaryPredicate(new ConstantFunction(Boolean.TRUE));
           assertEquals(p,p);
           assertObjectsAreEqual(p,new UnaryFunctionUnaryPredicate(new ConstantFunction(Boolean.TRUE)));
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
           assertObjectsAreNotEqual(p,new UnaryFunctionUnaryPredicate(null));
           assertObjectsAreNotEqual(p,new UnaryFunctionUnaryPredicate(new ConstantFunction(Boolean.FALSE)));
           assertObjectsAreEqual(new UnaryFunctionUnaryPredicate(null),new UnaryFunctionUnaryPredicate(null));
  
  
  
  1.2       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsInstanceOf.java
  
  Index: TestIsInstanceOf.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsInstanceOf.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestIsInstanceOf.java	24 Feb 2003 11:38:06 -0000	1.1
  +++ TestIsInstanceOf.java	24 Nov 2003 20:31:19 -0000	1.2
  @@ -123,7 +123,7 @@
           UnaryPredicate p = new IsInstanceOf(Object.class);
           assertEquals(p,p);
           assertObjectsAreEqual(p,new IsInstanceOf(Object.class));
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
           assertObjectsAreNotEqual(p,new IsInstanceOf(null));
           assertObjectsAreNotEqual(p,new IsInstanceOf(String.class));
       }
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsNotEqual.java
  
  Index: TestIsNotEqual.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsNotEqual.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestIsNotEqual.java	24 Nov 2003 20:12:15 -0000	1.2
  +++ TestIsNotEqual.java	24 Nov 2003 20:31:19 -0000	1.3
  @@ -121,7 +121,7 @@
           assertEquals(p,p);
           assertObjectsAreEqual(p,new IsNotEqual());
           assertObjectsAreEqual(p,IsNotEqual.instance());
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
       public void testConstant() throws Exception {
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsNotNull.java
  
  Index: TestIsNotNull.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsNotNull.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestIsNotNull.java	24 Nov 2003 20:12:15 -0000	1.2
  +++ TestIsNotNull.java	24 Nov 2003 20:31:19 -0000	1.3
  @@ -112,7 +112,7 @@
           assertEquals(p,p);
           assertObjectsAreEqual(p,new IsNotNull());
           assertObjectsAreEqual(p,IsNotNull.instance());
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
       public void testConstant() throws Exception {
  
  
  
  1.3       +12 -12    jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestConstantPredicate.java
  
  Index: TestConstantPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestConstantPredicate.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestConstantPredicate.java	4 Mar 2003 23:11:12 -0000	1.2
  +++ TestConstantPredicate.java	24 Nov 2003 20:31:19 -0000	1.3
  @@ -124,27 +124,27 @@
       public void testEquals() throws Exception {
           ConstantPredicate truePred = new ConstantPredicate(true);
           assertEquals(truePred,truePred);
  -        assertObjectsAreEqual(truePred,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreEqual(truePred,ConstantPredicate.trueInstance());
   
           ConstantPredicate falsePred = new ConstantPredicate(false);
           assertEquals(falsePred,falsePred);
  -        assertObjectsAreEqual(falsePred,ConstantPredicate.getFalsePredicate());
  +        assertObjectsAreEqual(falsePred,ConstantPredicate.falseInstance());
   
           assertObjectsAreNotEqual(truePred,falsePred);
       }
   
       public void testConstants() throws Exception {
  -        assertEquals(ConstantPredicate.getTruePredicate(),ConstantPredicate.getTruePredicate());
  -        assertSame(ConstantPredicate.getTruePredicate(),ConstantPredicate.getTruePredicate());
  +        assertEquals(ConstantPredicate.trueInstance(),ConstantPredicate.trueInstance());
  +        assertSame(ConstantPredicate.trueInstance(),ConstantPredicate.trueInstance());
   
  -        assertEquals(ConstantPredicate.getConstantPredicate(true),ConstantPredicate.getTruePredicate());
  -        assertSame(ConstantPredicate.getConstantPredicate(true),ConstantPredicate.getTruePredicate());
  +        assertEquals(ConstantPredicate.instance(true),ConstantPredicate.trueInstance());
  +        assertSame(ConstantPredicate.instance(true),ConstantPredicate.trueInstance());
   
  -        assertEquals(ConstantPredicate.getFalsePredicate(),ConstantPredicate.getFalsePredicate());
  -        assertSame(ConstantPredicate.getFalsePredicate(),ConstantPredicate.getFalsePredicate());
  +        assertEquals(ConstantPredicate.falseInstance(),ConstantPredicate.falseInstance());
  +        assertSame(ConstantPredicate.falseInstance(),ConstantPredicate.falseInstance());
   
  -        assertEquals(ConstantPredicate.getConstantPredicate(false),ConstantPredicate.getFalsePredicate());
  -        assertSame(ConstantPredicate.getConstantPredicate(false),ConstantPredicate.getFalsePredicate());
  +        assertEquals(ConstantPredicate.instance(false),ConstantPredicate.falseInstance());
  +        assertSame(ConstantPredicate.instance(false),ConstantPredicate.falseInstance());
       }
       
   }
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsNull.java
  
  Index: TestIsNull.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsNull.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestIsNull.java	24 Nov 2003 20:12:15 -0000	1.2
  +++ TestIsNull.java	24 Nov 2003 20:31:19 -0000	1.3
  @@ -112,7 +112,7 @@
           assertEquals(p,p);
           assertObjectsAreEqual(p,new IsNull());
           assertObjectsAreEqual(p,IsNull.instance());
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
       public void testConstant() throws Exception {
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsEqual.java
  
  Index: TestIsEqual.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/TestIsEqual.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestIsEqual.java	24 Nov 2003 20:12:15 -0000	1.2
  +++ TestIsEqual.java	24 Nov 2003 20:31:19 -0000	1.3
  @@ -122,7 +122,7 @@
   
           assertObjectsAreEqual(f,new IsEqual());
           assertObjectsAreEqual(f,IsEqual.instance());
  -        assertObjectsAreNotEqual(f,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(f,ConstantPredicate.trueInstance());
       }
   
       public void testConstant() throws Exception {
  
  
  
  1.5       +3 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/collection/TestIsElementOf.java
  
  Index: TestIsElementOf.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/collection/TestIsElementOf.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestIsElementOf.java	24 Nov 2003 20:29:23 -0000	1.4
  +++ TestIsElementOf.java	24 Nov 2003 20:31:20 -0000	1.5
  @@ -127,6 +127,6 @@
           assertObjectsAreEqual(p1, new IsElementOf());
           assertObjectsAreEqual(p1, IsElementOf.instance());
           assertSame(IsElementOf.instance(), IsElementOf.instance());
  -        assertObjectsAreNotEqual(p1, ConstantPredicate.getFalsePredicate());
  +        assertObjectsAreNotEqual(p1, ConstantPredicate.falseInstance());
       }
   }
  
  
  
  1.3       +6 -6      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/collection/TestPredicatedIterator.java
  
  Index: TestPredicatedIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/collection/TestPredicatedIterator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestPredicatedIterator.java	21 Feb 2003 00:12:28 -0000	1.2
  +++ TestPredicatedIterator.java	24 Nov 2003 20:31:20 -0000	1.3
  @@ -132,7 +132,7 @@
   
       public void testAllPass2() {
           Iterator expected = list.iterator();
  -        Iterator testing = new PredicatedIterator(ConstantPredicate.getTruePredicate(),list.iterator());
  +        Iterator testing = new PredicatedIterator(ConstantPredicate.trueInstance(),list.iterator());
           while(expected.hasNext()) {
               assertTrue(testing.hasNext());
               assertEquals(expected.next(),testing.next());
  @@ -146,7 +146,7 @@
       }
   
       public void testNonePass() {
  -        Iterator testing = new PredicatedIterator(ConstantPredicate.getFalsePredicate(),Collections.EMPTY_LIST.iterator());
  +        Iterator testing = new PredicatedIterator(ConstantPredicate.falseInstance(),Collections.EMPTY_LIST.iterator());
           assertTrue(!testing.hasNext());
       }
   
  @@ -217,7 +217,7 @@
       }
   
       public void testRemoveAll() {
  -        Iterator testing = new PredicatedIterator(ConstantPredicate.getTruePredicate(),list.iterator());
  +        Iterator testing = new PredicatedIterator(ConstantPredicate.trueInstance(),list.iterator());
           while(testing.hasNext()) {
               testing.next();
               testing.remove();
  @@ -226,7 +226,7 @@
       }
   
       public void testRemoveWithoutHasNext() {
  -        Iterator testing = new PredicatedIterator(ConstantPredicate.getTruePredicate(),list.iterator());
  +        Iterator testing = new PredicatedIterator(ConstantPredicate.trueInstance(),list.iterator());
           for(int i=0,m = list.size();i<m;i++) {
               testing.next();
               testing.remove();
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestBinaryNot.java
  
  Index: TestBinaryNot.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestBinaryNot.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBinaryNot.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestBinaryNot.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -109,12 +109,12 @@
       }
       
       public void testEquals() throws Exception {
  -        BinaryNot p = new BinaryNot(ConstantPredicate.getTruePredicate());
  +        BinaryNot p = new BinaryNot(ConstantPredicate.trueInstance());
           assertEquals(p,p);
           assertObjectsAreEqual(p,new BinaryNot(new ConstantPredicate(true)));
           assertObjectsAreEqual(p,BinaryNot.not(new ConstantPredicate(true)));
           assertObjectsAreNotEqual(p,new BinaryNot(new ConstantPredicate(false)));
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
           assertObjectsAreNotEqual(p,new BinaryNot(null));
       }
   
  @@ -123,6 +123,6 @@
       }
   
       public void testNotNotNull() throws Exception {
  -        assertNotNull(BinaryNot.not(ConstantPredicate.getTruePredicate()));
  +        assertNotNull(BinaryNot.not(ConstantPredicate.trueInstance()));
       }
   }
  
  
  
  1.3       +7 -7      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestTransposedPredicate.java
  
  Index: TestTransposedPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestTransposedPredicate.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestTransposedPredicate.java	4 Mar 2003 23:11:11 -0000	1.2
  +++ TestTransposedPredicate.java	24 Nov 2003 20:31:20 -0000	1.3
  @@ -86,7 +86,7 @@
       // ------------------------------------------------------------------------
   
       protected Object makeFunctor() {
  -        return new TransposedPredicate(ConstantPredicate.getTruePredicate());
  +        return new TransposedPredicate(ConstantPredicate.trueInstance());
       }
   
       // Lifecycle
  @@ -110,11 +110,11 @@
       }
           
       public void testEquals() throws Exception {
  -        BinaryPredicate p = new TransposedPredicate(ConstantPredicate.getTruePredicate());
  +        BinaryPredicate p = new TransposedPredicate(ConstantPredicate.trueInstance());
           assertEquals(p,p);
  -        assertObjectsAreEqual(p,new TransposedPredicate(ConstantPredicate.getTruePredicate()));
  -        assertObjectsAreEqual(p,TransposedPredicate.transpose(ConstantPredicate.getTruePredicate()));
  -        assertObjectsAreNotEqual(p,new TransposedPredicate(ConstantPredicate.getFalsePredicate()));
  +        assertObjectsAreEqual(p,new TransposedPredicate(ConstantPredicate.trueInstance()));
  +        assertObjectsAreEqual(p,TransposedPredicate.transpose(ConstantPredicate.trueInstance()));
  +        assertObjectsAreNotEqual(p,new TransposedPredicate(ConstantPredicate.falseInstance()));
           assertObjectsAreNotEqual(p,new TransposedPredicate(null));
           assertObjectsAreNotEqual(p,new ConstantPredicate(true));
       }
  
  
  
  1.2       +9 -9      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestOr.java
  
  Index: TestOr.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestOr.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestOr.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestOr.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -169,22 +169,22 @@
           assertObjectsAreNotEqual(p,r);
           
           for(int i=0;i<3;i++) {
  -            p.or(ConstantPredicate.getTruePredicate());
  +            p.or(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,q);
  -            q.or(ConstantPredicate.getTruePredicate());
  +            q.or(ConstantPredicate.trueInstance());
               assertObjectsAreEqual(p,q);
  -            r.and(ConstantPredicate.getTruePredicate());
  +            r.and(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,r);
   
  -            p.or(new Or(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            p.or(new Or(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,q);            
  -            q.or(new Or(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            q.or(new Or(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreEqual(p,q);            
  -            r.and(new Or(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            r.and(new Or(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,r);
           }
           
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
   }
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestNot.java
  
  Index: TestNot.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestNot.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestNot.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestNot.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -107,12 +107,12 @@
       }
       
       public void testEquals() throws Exception {
  -        Not p = new Not(ConstantPredicate.getTruePredicate());
  +        Not p = new Not(ConstantPredicate.trueInstance());
           assertEquals(p,p);
           assertObjectsAreEqual(p,new Not(new ConstantPredicate(true)));
           assertObjectsAreEqual(p,Not.not(new ConstantPredicate(true)));
           assertObjectsAreNotEqual(p,new Not(new ConstantPredicate(false)));
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
           assertObjectsAreNotEqual(p,new Not(null));
       }
   
  @@ -121,6 +121,6 @@
       }
   
       public void testNotNotNull() throws Exception {
  -        assertNotNull(Not.not(ConstantPredicate.getTruePredicate()));
  +        assertNotNull(Not.not(ConstantPredicate.trueInstance()));
       }
   }
  
  
  
  1.2       +9 -9      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestUnaryOr.java
  
  Index: TestUnaryOr.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestUnaryOr.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestUnaryOr.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestUnaryOr.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -169,22 +169,22 @@
           assertObjectsAreNotEqual(p,r);
           
           for(int i=0;i<3;i++) {
  -            p.or(ConstantPredicate.getTruePredicate());
  +            p.or(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,q);
  -            q.or(ConstantPredicate.getTruePredicate());
  +            q.or(ConstantPredicate.trueInstance());
               assertObjectsAreEqual(p,q);
  -            r.and(ConstantPredicate.getTruePredicate());
  +            r.and(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,r);
   
  -            p.or(new UnaryOr(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            p.or(new UnaryOr(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,q);            
  -            q.or(new UnaryOr(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            q.or(new UnaryOr(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreEqual(p,q);            
  -            r.and(new UnaryOr(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            r.and(new UnaryOr(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,r);
           }
           
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
   }
  
  
  
  1.2       +7 -7      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestUnaryAnd.java
  
  Index: TestUnaryAnd.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestUnaryAnd.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestUnaryAnd.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestUnaryAnd.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -165,17 +165,17 @@
           assertObjectsAreEqual(p,q);
   
           for(int i=0;i<3;i++) {
  -            p.and(ConstantPredicate.getTruePredicate());
  +            p.and(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,q);
  -            q.and(ConstantPredicate.getTruePredicate());
  +            q.and(ConstantPredicate.trueInstance());
               assertObjectsAreEqual(p,q);
  -            p.and(new UnaryAnd(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            p.and(new UnaryAnd(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,q);            
  -            q.and(new UnaryAnd(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            q.and(new UnaryAnd(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreEqual(p,q);            
           }
           
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
   }
  
  
  
  1.2       +7 -7      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestAnd.java
  
  Index: TestAnd.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestAnd.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestAnd.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestAnd.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -165,17 +165,17 @@
           assertObjectsAreEqual(p,q);
   
           for(int i=0;i<3;i++) {
  -            p.and(ConstantPredicate.getTruePredicate());
  +            p.and(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,q);
  -            q.and(ConstantPredicate.getTruePredicate());
  +            q.and(ConstantPredicate.trueInstance());
               assertObjectsAreEqual(p,q);
  -            p.and(new And(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            p.and(new And(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,q);            
  -            q.and(new And(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            q.and(new And(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreEqual(p,q);            
           }
           
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
   }
  
  
  
  1.2       +7 -7      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestBinaryAnd.java
  
  Index: TestBinaryAnd.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestBinaryAnd.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBinaryAnd.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestBinaryAnd.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -167,17 +167,17 @@
           assertObjectsAreNotEqual(p,r);
   
           for(int i=0;i<3;i++) {
  -            p.and(ConstantPredicate.getTruePredicate());
  +            p.and(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,q);
  -            q.and(ConstantPredicate.getTruePredicate());
  +            q.and(ConstantPredicate.trueInstance());
               assertObjectsAreEqual(p,q);
  -            p.and(new BinaryAnd(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            p.and(new BinaryAnd(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,q);            
  -            q.and(new BinaryAnd(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            q.and(new BinaryAnd(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreEqual(p,q);            
           }
           
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
   }
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestUnaryNot.java
  
  Index: TestUnaryNot.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestUnaryNot.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestUnaryNot.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestUnaryNot.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -109,12 +109,12 @@
       }
       
       public void testEquals() throws Exception {
  -        UnaryNot p = new UnaryNot(ConstantPredicate.getTruePredicate());
  +        UnaryNot p = new UnaryNot(ConstantPredicate.trueInstance());
           assertEquals(p,p);
           assertObjectsAreEqual(p,new UnaryNot(new ConstantPredicate(true)));
           assertObjectsAreEqual(p,UnaryNot.not(new ConstantPredicate(true)));
           assertObjectsAreNotEqual(p,new UnaryNot(new ConstantPredicate(false)));
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
           assertObjectsAreNotEqual(p,new UnaryNot(null));
       }
   
  @@ -123,6 +123,6 @@
       }
   
       public void testNotNotNull() throws Exception {
  -        assertNotNull(UnaryNot.not(ConstantPredicate.getTruePredicate()));
  +        assertNotNull(UnaryNot.not(ConstantPredicate.trueInstance()));
       }
   }
  
  
  
  1.2       +9 -9      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestBinaryOr.java
  
  Index: TestBinaryOr.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/core/composite/TestBinaryOr.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBinaryOr.java	4 Mar 2003 14:48:08 -0000	1.1
  +++ TestBinaryOr.java	24 Nov 2003 20:31:20 -0000	1.2
  @@ -169,22 +169,22 @@
           assertObjectsAreNotEqual(p,r);
           
           for(int i=0;i<3;i++) {
  -            p.or(ConstantPredicate.getTruePredicate());
  +            p.or(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,q);
  -            q.or(ConstantPredicate.getTruePredicate());
  +            q.or(ConstantPredicate.trueInstance());
               assertObjectsAreEqual(p,q);
  -            r.and(ConstantPredicate.getTruePredicate());
  +            r.and(ConstantPredicate.trueInstance());
               assertObjectsAreNotEqual(p,r);
   
  -            p.or(new BinaryOr(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            p.or(new BinaryOr(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,q);            
  -            q.or(new BinaryOr(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            q.or(new BinaryOr(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreEqual(p,q);            
  -            r.and(new BinaryOr(ConstantPredicate.getTruePredicate(),ConstantPredicate.getFalsePredicate()));
  +            r.and(new BinaryOr(ConstantPredicate.trueInstance(),ConstantPredicate.falseInstance()));
               assertObjectsAreNotEqual(p,r);
           }
           
  -        assertObjectsAreNotEqual(p,ConstantPredicate.getTruePredicate());
  +        assertObjectsAreNotEqual(p,ConstantPredicate.trueInstance());
       }
   
   }
  
  
  
  1.3       +5 -5      jakarta-commons-sandbox/functor/src/java/org/apache/commons/functor/core/ConstantPredicate.java
  
  Index: ConstantPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/java/org/apache/commons/functor/core/ConstantPredicate.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConstantPredicate.java	28 Jan 2003 12:00:28 -0000	1.2
  +++ ConstantPredicate.java	24 Nov 2003 20:31:20 -0000	1.3
  @@ -150,7 +150,7 @@
        * @return a <code>ConstantPredicate</code> that always
        *         returns <code>true</code>
        */
  -    public static ConstantPredicate getTruePredicate() {
  +    public static ConstantPredicate trueInstance() {
           return TRUE_PREDICATE;
       }
   
  @@ -160,7 +160,7 @@
        * @return a <code>ConstantPredicate</code> that always
        *         returns <code>false</code>
        */
  -    public static ConstantPredicate getFalsePredicate() {
  +    public static ConstantPredicate falseInstance() {
           return FALSE_PREDICATE;
       }
       
  @@ -171,7 +171,7 @@
        * @return a <code>ConstantPredicate</code> that always
        *         returns <i>value</i>
        */
  -    public static ConstantPredicate getConstantPredicate(boolean value) {
  +    public static ConstantPredicate instance(boolean value) {
           return value ? TRUE_PREDICATE : FALSE_PREDICATE;
       }
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message