All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.staccatocommons.defs.Delayable3 Maven / Gradle / Ivy

Go to download

Minimal definitions library that provides very abstract interfaces with well defined but generic semantics, focused on code reuse.

The newest version!
/**
 *  Copyright (c) 2010-2012, The StaccatoCommons Team
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation; version 3 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 */


package net.sf.staccatocommons.defs;

import net.sf.staccatocommons.restrictions.check.NonNull;

/**
 * {@link Delayable3}s are delayed transformations that take three arguments and
 * return a thunk that will perform the actual processing when evaluated, by
 * implementing a {@link #delayed(Object, Object, Object)} method.
 * 
 * @author flbulgarelli
 * 
 * @param 
 *          first argument type
 * @param 
 *          second argument type
 * @param 
 *          third argument type
 * @param 
 *          return type type of returned thunk
 * @see Applicative Recomendations for implementing
 * @see Thunk
 */
@Applicative
public interface Delayable3 {

  /**
   * Asynchronously applies this {@link Delayable3}, by returning a
   * {@link Thunk} that will perform the actual transformation each time it is
   * evaluated.
   * 
   * @param arg0
   * @param arg1
   * @param arg2
   * @return a new {@link Thunk}.
   */
  @NonNull
  Thunk delayed(final A arg0, final B arg1, final C arg2);

  /**
   * Asynchronously applies this {@link Delayable3}, by returning a
   * {@link Thunk} that will perform the actual transformation on the given
   * thunk's values each time it is evaluated.
   * 
   * @param arg0
   * @param arg1
   * @param arg2
   * @return a new {@link Thunk}.
   */
  @NonNull
  Thunk delayedValue(@NonNull Thunk thunk0, @NonNull Thunk thunk1, @NonNull Thunk thunk2);

}