samples/growingparameters/src-api1.0/api/request/response/Compute.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:53:38 +0200
changeset 78 af48bccb02cb
child 192 78bf0774975d
permissions -rw-r--r--
Finished re-reading of "classes vs. interfaces"
     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             this.result.add(s);
    25         }
    26         
    27         public void addAll(List<String> all) {
    28             this.result.addAll(all);
    29         }
    30     }
    31 }