samples/growingparameters/src-api1.0/api/request/response/Compute.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 10:04:53 +0200
changeset 210 acf2c31e22d4
parent 209 1c999569643b
permissions -rw-r--r--
Merge: Geertjan's changes to the end of the chapter
     1 package api.request.response;
     2 
     3 import java.util.List;
     4 
     5 public interface Compute {
     6     public void computeData(Request request, Response response);
     7     
     8     /** Right now useless, but may be handy in future */
     9     public final class Request {
    10         /** allow access just from friend code */
    11         Request() {
    12         }
    13     }
    14     
    15     /** Allows clients to provide the computed strings */
    16     public final class Response {
    17         private final List<String> result;
    18         /** Allow access only to friend code */
    19         Response(List<String> result) {
    20             this.result = result;
    21         }
    22         
    23         public void add(String s) {
    24             result.add(s);
    25         }
    26         
    27         public void addAll(List<String> all) {
    28             result.addAll(all);
    29         }
    30     }
    31 }