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
    3    * or more contributor license agreements. See the NOTICE file
    4    * distributed with this work for additional information
    5    * regarding copyright ownership. The ASF licenses this file
    6    * to you under the Apache License, Version 2.0 (the
    7    * "License"); you may not use this file except in compliance
    8    * with the License. You may obtain a copy of the License at
    9    *
   10    * http://www.apache.org/licenses/LICENSE-2.0
   11    *
   12    * Unless required by applicable law or agreed to in writing,
   13    * software distributed under the License is distributed on an
   14    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   15    * KIND, either express or implied. See the License for the
   16    * specific language governing permissions and limitations
   17    * under the License.
   18    */
   19   package org.apache.mahout.math.function;
   20   
   21   /**
   22    * Interface that represents a procedure object: 
   23    * a procedure that takes two arguments and returns a 'continue' flag.
   24    */
   25   public interface ObjectObjectProcedure<K,V> {
   26   
   27     /**
   28      * Applies a procedure to an argument. Optionally can return a boolean flag to inform the object calling the
   29      * procedure.
   30      *
   31      * <p>Example: forEach() methods often use procedure objects. To signal to a forEach() method whether iteration should
   32      * continue normally or terminate (because for example a matching element has been found), a procedure can return
   33      * <tt>false</tt> to indicate termination and <tt>true</tt> to indicate continuation.
   34      *
   35      * @param key key value passed to the procedure
   36      * @param value value value passed to the procedure.
   37      * @return a flag  to inform the object calling the procedure.
   38      */
   39     boolean apply(K key, V value);
   40   }

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