Save This Page
Home » mahout-collections-1.0-src » org.apache.mahout.math.function » [javadoc | source]
    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   
   18   /*
   19   Copyright 1999 CERN - European Organization for Nuclear Research.
   20   Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose
   21   is hereby granted without fee, provided that the above copyright notice appear in all copies and
   22   that both that copyright notice and this permission notice appear in supporting documentation.
   23   CERN makes no representations about the suitability of this software for any purpose.
   24   It is provided "as is" without expressed or implied warranty.
   25   */
   26   
   27   
   28   package org.apache.mahout.math.function;
   29   
   30   /**
   31    * Interface that represents a procedure object: a procedure that takes a single argument and does not return a value.
   32    */
   33   public interface ObjectProcedure<T> {
   34   
   35     /**
   36      * Applies a procedure to an argument. Optionally can return a boolean flag to inform the object calling the
   37      * procedure.
   38      *
   39      * <p>Example: forEach() methods often use procedure objects. To signal to a forEach() method whether iteration should
   40      * continue normally or terminate (because for example a matching element has been found), a procedure can return
   41      * <tt>false</tt> to indicate termination and <tt>true</tt> to indicate continuation.
   42      *
   43      * @param element element passed to the procedure.
   44      * @return a flag  to inform the object calling the procedure.
   45      */
   46     boolean apply(T element);
   47   }

Save This Page
Home » mahout-collections-1.0-src » org.apache.mahout.math.function » [javadoc | source]