commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/functors NullIsExceptionPredicate.java OnePredicate.java OrPredicate.java NullIsFalsePredicate.java TransformedPredicate.java AllPredicate.java InstanceofPredicate.java FalsePredicate.java UniquePredicate.java NullIsTruePredicate.java TransformerPredicate.java NonePredicate.java AndPredicate.java AnyPredicate.java NotPredicate.java EqualPredicate.java TruePredicate.java IdentityPredicate.java ExceptionPredicate.java NullPredicate.java
Date Sun, 16 May 2004 11:16:01 GMT
scolebourne    2004/05/16 04:16:01

  Modified:    collections/src/java/org/apache/commons/collections/functors
                        NullIsExceptionPredicate.java OnePredicate.java
                        OrPredicate.java NullIsFalsePredicate.java
                        TransformedPredicate.java AllPredicate.java
                        InstanceofPredicate.java FalsePredicate.java
                        UniquePredicate.java NullIsTruePredicate.java
                        TransformerPredicate.java NonePredicate.java
                        AndPredicate.java AnyPredicate.java
                        NotPredicate.java EqualPredicate.java
                        TruePredicate.java IdentityPredicate.java
                        ExceptionPredicate.java NullPredicate.java
  Log:
  Javadoc
  
  Revision  Changes    Path
  1.6       +8 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullIsExceptionPredicate.java
  
  Index: NullIsExceptionPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullIsExceptionPredicate.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NullIsExceptionPredicate.java	13 Mar 2004 17:17:03 -0000	1.5
  +++ NullIsExceptionPredicate.java	16 May 2004 11:16:01 -0000	1.6
  @@ -62,7 +62,12 @@
       }
   
       /**
  -     * Return true if the object equals null else call the decorated predicate.
  +     * Evaluates the predicate returning the result of the decorated predicate
  +     * once a null check is performed.
  +     * 
  +     * @param object  the input object
  +     * @return true if decorated predicate returns true
  +     * @throws FunctorException if input is null
        */
       public boolean evaluate(Object object) {
           if (object == null) {
  @@ -73,6 +78,7 @@
   
       /**
        * Gets the predicate.
  +     * 
        * @return the predicate
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +7 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/OnePredicate.java
  
  Index: OnePredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/OnePredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- OnePredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ OnePredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -77,7 +77,11 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if only one decorated predicate
  +     * returns true.
  +     * 
  +     * @param object  the input object
  +     * @return true if only one decorated predicate returns true
        */
       public boolean evaluate(Object object) {
           boolean match = false;
  @@ -94,6 +98,7 @@
   
       /**
        * Gets the predicates, do not modify the array.
  +     * 
        * @return the predicates
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/OrPredicate.java
  
  Index: OrPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/OrPredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- OrPredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ OrPredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -66,7 +66,10 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if either predicate returns true.
  +     * 
  +     * @param object  the input object
  +     * @return true if either decorated predicate returns true
        */
       public boolean evaluate(Object object) {
          return (iPredicate1.evaluate(object) || iPredicate2.evaluate(object));
  @@ -74,6 +77,7 @@
   
       /**
        * Gets the first predicate.
  +     * 
        * @return the predicate
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +7 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullIsFalsePredicate.java
  
  Index: NullIsFalsePredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullIsFalsePredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NullIsFalsePredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ NullIsFalsePredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -61,7 +61,11 @@
       }
   
       /**
  -     * Return false if the object equals null else call the decorated predicate.
  +     * Evaluates the predicate returning the result of the decorated predicate
  +     * once a null check is performed.
  +     * 
  +     * @param object  the input object
  +     * @return true if decorated predicate returns true, false if input is null
        */
       public boolean evaluate(Object object) {
           if (object == null) {
  @@ -72,6 +76,7 @@
   
       /**
        * Gets the predicate.
  +     * 
        * @return the predicate
        * @since Commons Collections 3.1
        */
  
  
  
  1.3       +11 -2     jakarta-commons/collections/src/java/org/apache/commons/collections/functors/TransformedPredicate.java
  
  Index: TransformedPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/TransformedPredicate.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransformedPredicate.java	13 Mar 2004 17:15:17 -0000	1.2
  +++ TransformedPredicate.java	16 May 2004 11:16:01 -0000	1.3
  @@ -60,6 +60,9 @@
       /**
        * Constructor that performs no validation.
        * Use <code>getInstance</code> if you want that.
  +     * 
  +     * @param transformer  the transformer to use
  +     * @param predicate  the predicate to decorate
        */
       public TransformedPredicate(Transformer transformer, Predicate predicate) {
           iTransformer = transformer;
  @@ -67,7 +70,11 @@
       }
       
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning the result of the decorated predicate
  +     * once the input has been transformed
  +     * 
  +     * @param object  the input object which will be transformed
  +     * @return true if decorated predicate returns true
        */
       public boolean evaluate(Object object) {
           Object result = iTransformer.transform(object);
  @@ -76,6 +83,7 @@
   
       /**
        * Gets the predicate in use.
  +     * 
        * @return the predicate
        */
       public Predicate getPredicate() {
  @@ -84,6 +92,7 @@
   
       /**
        * Gets the transformer in use.
  +     * 
        * @return the transformer
        */
       public Transformer getTransformer() {
  
  
  
  1.5       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/AllPredicate.java
  
  Index: AllPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/AllPredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AllPredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ AllPredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -77,7 +77,10 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if all predicates return true.
  +     * 
  +     * @param object  the input object
  +     * @return true if all decorated predicates return true
        */
       public boolean evaluate(Object object) {
           for (int i = 0; i < iPredicates.length; i++) {
  @@ -90,6 +93,7 @@
   
       /**
        * Gets the predicates, do not modify the array.
  +     * 
        * @return the predicates
        * @since Commons Collections 3.1
        */
  
  
  
  1.6       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/InstanceofPredicate.java
  
  Index: InstanceofPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/InstanceofPredicate.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- InstanceofPredicate.java	13 Mar 2004 17:17:03 -0000	1.5
  +++ InstanceofPredicate.java	16 May 2004 11:16:01 -0000	1.6
  @@ -62,7 +62,10 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if the input object is of the correct type.
  +     * 
  +     * @param object  the input object
  +     * @return true if input is of stored type
        */
       public boolean evaluate(Object object) {
           return (iType.isInstance(object));
  @@ -70,6 +73,7 @@
   
       /**
        * Gets the type to compare to.
  +     * 
        * @return the type
        * @since Commons Collections 3.1
        */
  
  
  
  1.6       +6 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/FalsePredicate.java
  
  Index: FalsePredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/FalsePredicate.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FalsePredicate.java	31 Mar 2004 23:13:04 -0000	1.5
  +++ FalsePredicate.java	16 May 2004 11:16:01 -0000	1.6
  @@ -53,10 +53,13 @@
       }
   
       /**
  -     * Always return true.
  +     * Evaluates the predicate returning false always.
  +     * 
  +     * @param object  the input object
  +     * @return false always
        */
       public boolean evaluate(Object object) {
           return false;
       }
  -    
  +
   }
  
  
  
  1.4       +7 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/UniquePredicate.java
  
  Index: UniquePredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/UniquePredicate.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UniquePredicate.java	18 Feb 2004 00:59:20 -0000	1.3
  +++ UniquePredicate.java	16 May 2004 11:16:01 -0000	1.4
  @@ -57,10 +57,14 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if the input object hasn't been
  +     * received yet.
  +     * 
  +     * @param object  the input object
  +     * @return true if this is the first time the object is seen
        */
       public boolean evaluate(Object object) {
           return iSet.add(object);
       }
  -    
  +
   }
  
  
  
  1.5       +7 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullIsTruePredicate.java
  
  Index: NullIsTruePredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullIsTruePredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NullIsTruePredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ NullIsTruePredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -61,7 +61,11 @@
       }
   
       /**
  -     * Return true if the object equals null else call the decorated predicate.
  +     * Evaluates the predicate returning the result of the decorated predicate
  +     * once a null check is performed.
  +     * 
  +     * @param object  the input object
  +     * @return true if decorated predicate returns true or input is null
        */
       public boolean evaluate(Object object) {
           if (object == null) {
  @@ -72,6 +76,7 @@
   
       /**
        * Gets the predicate.
  +     * 
        * @return the predicate
        * @since Commons Collections 3.1
        */
  
  
  
  1.6       +11 -3     jakarta-commons/collections/src/java/org/apache/commons/collections/functors/TransformerPredicate.java
  
  Index: TransformerPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/TransformerPredicate.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TransformerPredicate.java	13 Mar 2004 17:17:03 -0000	1.5
  +++ TransformerPredicate.java	16 May 2004 11:16:01 -0000	1.6
  @@ -40,7 +40,8 @@
       /**
        * Factory to create the predicate.
        * 
  -     * @return the transformer
  +     * @param transformer  the transformer to decorate
  +     * @return the predicate
        * @throws IllegalArgumentException if the transformer is null
        */
       public static Predicate getInstance(Transformer transformer) {
  @@ -53,6 +54,8 @@
       /**
        * Constructor that performs no validation.
        * Use <code>getInstance</code> if you want that.
  +     * 
  +     * @param transformer  the transformer to decorate
        */
       public TransformerPredicate(Transformer transformer) {
           super();
  @@ -60,7 +63,11 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning the result of the decorated transformer.
  +     * 
  +     * @param object  the input object
  +     * @return true if decorated transformer returns Boolean.TRUE
  +     * @throws FunctorException if the transformer returns an invalid type
        */
       public boolean evaluate(Object object) {
           Object result = iTransformer.transform(object);
  @@ -74,6 +81,7 @@
   
       /**
        * Gets the transformer.
  +     * 
        * @return the transformer
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NonePredicate.java
  
  Index: NonePredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NonePredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NonePredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ NonePredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -77,7 +77,10 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning false if any stored predicate returns false.
  +     * 
  +     * @param object  the input object
  +     * @return true if none of decorated predicates return true
        */
       public boolean evaluate(Object object) {
           for (int i = 0; i < iPredicates.length; i++) {
  @@ -90,6 +93,7 @@
   
       /**
        * Gets the predicates, do not modify the array.
  +     * 
        * @return the predicates
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +7 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/AndPredicate.java
  
  Index: AndPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/AndPredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AndPredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ AndPredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -66,7 +66,10 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if both predicates return true.
  +     * 
  +     * @param object  the input object
  +     * @return true if both decorated predicates return true
        */
       public boolean evaluate(Object object) {
          return (iPredicate1.evaluate(object) && iPredicate2.evaluate(object));
  @@ -74,6 +77,7 @@
   
       /**
        * Gets the first predicate.
  +     * 
        * @return the predicate
        * @since Commons Collections 3.1
        */
  @@ -83,6 +87,7 @@
   
       /**
        * Gets the second predicate.
  +     * 
        * @return the predicate
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/AnyPredicate.java
  
  Index: AnyPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/AnyPredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AnyPredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ AnyPredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -77,7 +77,10 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if any predicate returns true.
  +     * 
  +     * @param object  the input object
  +     * @return true if any decorated predicate return true
        */
       public boolean evaluate(Object object) {
           for (int i = 0; i < iPredicates.length; i++) {
  @@ -90,6 +93,7 @@
   
       /**
        * Gets the predicates, do not modify the array.
  +     * 
        * @return the predicates
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NotPredicate.java
  
  Index: NotPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NotPredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NotPredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ NotPredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -61,7 +61,10 @@
       }
   
       /**
  -     * Return the negated predicate result.
  +     * Evaluates the predicate returning the opposite to the stored predicate.
  +     * 
  +     * @param object  the input object
  +     * @return true if predicate returns false
        */
       public boolean evaluate(Object object) {
           return !(iPredicate.evaluate(object));
  @@ -69,6 +72,7 @@
   
       /**
        * Gets the predicate.
  +     * 
        * @return the predicate
        * @since Commons Collections 3.1
        */
  
  
  
  1.5       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/EqualPredicate.java
  
  Index: EqualPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/EqualPredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EqualPredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ EqualPredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -62,7 +62,10 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if the input equals the stored value.
  +     * 
  +     * @param object  the input object
  +     * @return true if input object equals stored value
        */
       public boolean evaluate(Object object) {
           return (iValue.equals(object));
  @@ -70,6 +73,7 @@
   
       /**
        * Gets the value.
  +     * 
        * @return the value
        * @since Commons Collections 3.1
        */
  
  
  
  1.6       +6 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/TruePredicate.java
  
  Index: TruePredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/TruePredicate.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TruePredicate.java	31 Mar 2004 23:13:04 -0000	1.5
  +++ TruePredicate.java	16 May 2004 11:16:01 -0000	1.6
  @@ -53,10 +53,13 @@
       }
   
       /**
  -     * Always return true.
  +     * Evaluates the predicate returning true always.
  +     * 
  +     * @param object  the input object
  +     * @return true always
        */
       public boolean evaluate(Object object) {
           return true;
       }
  -    
  +
   }
  
  
  
  1.5       +7 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/IdentityPredicate.java
  
  Index: IdentityPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/IdentityPredicate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IdentityPredicate.java	13 Mar 2004 17:17:03 -0000	1.4
  +++ IdentityPredicate.java	16 May 2004 11:16:01 -0000	1.5
  @@ -63,7 +63,11 @@
       }
   
       /**
  -     * Return the predicate result.
  +     * Evaluates the predicate returning true if the input object is identical to
  +     * the stored object.
  +     * 
  +     * @param object  the input object
  +     * @return true if input is the same object as the stored value
        */
       public boolean evaluate(Object object) {
           return (iValue == object);
  @@ -71,6 +75,7 @@
   
       /**
        * Gets the value.
  +     * 
        * @return the value
        * @since Commons Collections 3.1
        */
  
  
  
  1.7       +6 -2      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/ExceptionPredicate.java
  
  Index: ExceptionPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/ExceptionPredicate.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ExceptionPredicate.java	31 Mar 2004 23:13:04 -0000	1.6
  +++ ExceptionPredicate.java	16 May 2004 11:16:01 -0000	1.7
  @@ -54,7 +54,11 @@
       }
   
       /**
  -     * Always throw an exception
  +     * Evaluates the predicate always throwing an exception.
  +     * 
  +     * @param object  the input object
  +     * @return never
  +     * @throws FunctorException always
        */
       public boolean evaluate(Object object) {
           throw new FunctorException("ExceptionPredicate invoked");
  
  
  
  1.6       +6 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullPredicate.java
  
  Index: NullPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/functors/NullPredicate.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NullPredicate.java	31 Mar 2004 23:13:04 -0000	1.5
  +++ NullPredicate.java	16 May 2004 11:16:01 -0000	1.6
  @@ -53,10 +53,13 @@
       }
   
       /**
  -     * Return true if the object equals null.
  +     * Evaluates the predicate returning true if the input is null.
  +     * 
  +     * @param object  the input object
  +     * @return true if input is null
        */
       public boolean evaluate(Object object) {
           return (object == null);
       }
  -    
  +
   }
  
  
  

---------------------------------------------------------------------
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