001 /*
002 * Copyright 2002-2004 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005 * use this file except in compliance with the License. You may obtain a copy of
006 * the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013 * License for the specific language governing permissions and limitations under
014 * the License.
015 */
016 package org.springframework.rules.constraint;
017
018 import java.io.Serializable;
019 import java.util.Collection;
020 import java.util.Iterator;
021
022 import org.springframework.rules.constraint.Constraint;
023
024 public abstract class AbstractConstraint extends ConstraintsAccessor implements Constraint, Serializable {
025
026 public boolean allTrue(Collection collection) {
027 return allTrue(collection, this);
028 }
029
030 public boolean allTrue(Iterator it) {
031 return allTrue(it, this);
032 }
033
034 public boolean anyTrue(Collection collection) {
035 return anyTrue(collection, this);
036 }
037
038 public boolean anyTrue(Iterator it) {
039 return anyTrue(it, this);
040 }
041
042 public Collection findAll(Collection collection) {
043 return findAll(collection, this);
044 }
045
046 public Object findAll(Iterator it) {
047 return findAll(it, this);
048 }
049
050 public Object findFirst(Collection collection) {
051 return findFirst(collection, this);
052 }
053
054 public Object findFirst(Iterator it) {
055 return findFirst(it, this);
056 }
057 }