test/tools/javac/lambda/lambdaExecution/TBlock.java

Tue, 12 Mar 2013 16:02:43 +0000

author
mcimadamore
date
Tue, 12 Mar 2013 16:02:43 +0000
changeset 1628
5ddecb91d843
parent 0
959103a6100f
permissions
-rw-r--r--

8009545: Graph inference: dependencies between inference variables should be set during incorporation
Summary: Move all transitivity checks into the incorporation round
Reviewed-by: jjg

     1 /**
     2  * Performs operations upon an input object which may modify that object and/or
     3  * external state (other objects).
     4  *
     5  * <p>All block implementations are expected to:
     6  * <ul>
     7  * <li>When used for aggregate operations upon many elements blocks
     8  * should not assume that the {@code apply} operation will be called upon
     9  * elements in any specific order.</li>
    10  * </ul>
    11  *
    12  * @param <T> The type of input objects to {@code apply}.
    13  */
    14 public interface TBlock<T> {
    16     /**
    17      * Performs operations upon the provided object which may modify that object
    18      * and/or external state.
    19      *
    20      * @param t an input object
    21      */
    22     void apply(T t);
    24     /**
    25      * Returns a Block which performs in sequence the {@code apply} methods of
    26      * multiple Blocks. This Block's {@code apply} method is performed followed
    27      * by the {@code apply} method of the specified Block operation.
    28      *
    29      * @param other an additional Block which will be chained after this Block
    30      * @return a Block which performs in sequence the {@code apply} method of
    31      * this Block and the {@code apply} method of the specified Block operation
    32      */
    33     public default TBlock<T> chain(TBlock<? super T> other) {
    34         return (T t) -> { apply(t); other.apply(t); };
    35     }
    36 }

mercurial