URLs in apifest chapter replaced with code snippets
authorJaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:52:52 +0200
changeset 5902e05defc6a0
parent 58 be49ca0fff33
child 60 bea28c7c6653
URLs in apifest chapter replaced with code snippets
samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java
samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java
samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Function.java
samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/test/apifest/CircuitTest.java
samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/test/apifest/CircuitTest.java
samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/test/apifest/CircuitTest.java
     1.1 --- a/samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java	Sat Jun 14 09:52:52 2008 +0200
     1.2 +++ b/samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java	Sat Jun 14 09:52:52 2008 +0200
     1.3 @@ -19,8 +19,7 @@
     1.4  
     1.5  package org.netbeans.apifest.boolcircuit;
     1.6  
     1.7 -/**
     1.8 - */
     1.9 +// BEGIN: apifest.day2.elementbasedsolution.Circuit
    1.10  public final class Circuit {
    1.11      private Circuit() {
    1.12      }
    1.13 @@ -113,3 +112,4 @@
    1.14          public double computeResult(double... values);
    1.15      }
    1.16  }
    1.17 +// END: apifest.day2.elementbasedsolution.Circuit
     2.1 --- a/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java	Sat Jun 14 09:52:52 2008 +0200
     2.2 +++ b/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java	Sat Jun 14 09:52:52 2008 +0200
     2.3 @@ -96,9 +96,9 @@
     2.4          };
     2.5      }
     2.6  
     2.7 +    // BEGIN: apifest.day2.pinbasedsolution.FunctionFactory
     2.8      /**
     2.9       * Creates an Element with user-defined transfer function.
    2.10 -     *
    2.11       */
    2.12      public static Element createGate(final Element source1, final Element source2, final Function function) {
    2.13          return new Element() {
    2.14 @@ -115,5 +115,5 @@
    2.15              }
    2.16          };
    2.17      }
    2.18 -
    2.19 +    // END: apifest.day2.pinbasedsolution.FunctionFactory
    2.20  }
     3.1 --- a/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Function.java	Sat Jun 14 09:52:52 2008 +0200
     3.2 +++ b/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Function.java	Sat Jun 14 09:52:52 2008 +0200
     3.3 @@ -1,19 +1,10 @@
     3.4 -/*
     3.5 - * Function.java
     3.6 - *
     3.7 - * Created on 13. Ĩervenec 2006, 14:40
     3.8 - *
     3.9 - * To change this template, choose Tools | Template Manager
    3.10 - * and open the template in the editor.
    3.11 - */
    3.12 -
    3.13  package org.netbeans.apifest.boolcircuit;
    3.14  
    3.15 +// BEGIN: apifest.day2.pinbasedsolution.Function
    3.16  /**
    3.17   * An abstract transfer function of a gate.
    3.18 - * @author nenik
    3.19   */
    3.20  public abstract class Function {
    3.21 -    
    3.22      public abstract double evaluate(double input1, double input2);
    3.23  }
    3.24 +// END: apifest.day2.pinbasedsolution.Function
     4.1 --- a/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/test/apifest/CircuitTest.java	Sat Jun 14 09:52:52 2008 +0200
     4.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/test/apifest/CircuitTest.java	Sat Jun 14 09:52:52 2008 +0200
     4.3 @@ -6,6 +6,7 @@
     4.4  
     4.5  /** Write a test that works with version from day A and fails with version B.
     4.6   */
     4.7 +// BEGIN: apifest.day3.against-alwayscreatenewcircuit
     4.8  public class CircuitTest extends TestCase {
     4.9      public CircuitTest(String n) {
    4.10          super(n);
    4.11 @@ -16,3 +17,4 @@
    4.12          assertEquals(null, Circuit.or(false, false).getClass().getSuperclass().getSuperclass().getSuperclass());
    4.13      }
    4.14  }
    4.15 +// END: apifest.day3.against-alwayscreatenewcircuit
     5.1 --- a/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/test/apifest/CircuitTest.java	Sat Jun 14 09:52:52 2008 +0200
     5.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/test/apifest/CircuitTest.java	Sat Jun 14 09:52:52 2008 +0200
     5.3 @@ -46,6 +46,7 @@
     5.4  
     5.5  /** Write a test that works with version from day A and fails with version B.
     5.6   */
     5.7 +// BEGIN: apifest.day3.against-elementbasedsolution
     5.8  public class CircuitTest extends TestCase {
     5.9      public CircuitTest(String n) {
    5.10          super(n);
    5.11 @@ -61,3 +62,6 @@
    5.12          assertTrue (circuit.result());
    5.13      }
    5.14  }
    5.15 +// END: apifest.day3.against-elementbasedsolution
    5.16 +
    5.17 +
     6.1 --- a/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/test/apifest/CircuitTest.java	Sat Jun 14 09:52:52 2008 +0200
     6.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/test/apifest/CircuitTest.java	Sat Jun 14 09:52:52 2008 +0200
     6.3 @@ -1,43 +1,3 @@
     6.4 -/*
     6.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     6.6 - *
     6.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
     6.8 - *
     6.9 - * The contents of this file are subject to the terms of either the GNU
    6.10 - * General Public License Version 2 only ("GPL") or the Common
    6.11 - * Development and Distribution License("CDDL") (collectively, the
    6.12 - * "License"). You may not use this file except in compliance with the
    6.13 - * License. You can obtain a copy of the License at
    6.14 - * http://www.netbeans.org/cddl-gplv2.html
    6.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    6.16 - * specific language governing permissions and limitations under the
    6.17 - * License.  When distributing the software, include this License Header
    6.18 - * Notice in each file and include the License file at
    6.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    6.20 - * particular file as subject to the "Classpath" exception as provided
    6.21 - * by Sun in the GPL Version 2 section of the License file that
    6.22 - * accompanied this code. If applicable, add the following below the
    6.23 - * License Header, with the fields enclosed by brackets [] replaced by
    6.24 - * your own identifying information:
    6.25 - * "Portions Copyrighted [year] [name of copyright owner]"
    6.26 - *
    6.27 - * Contributor(s):
    6.28 - *
    6.29 - * The Original Software is NetBeans. The Initial Developer of the Original
    6.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
    6.31 - * Microsystems, Inc. All Rights Reserved.
    6.32 - *
    6.33 - * If you wish your version of this file to be governed by only the CDDL
    6.34 - * or only the GPL Version 2, indicate your decision by adding
    6.35 - * "[Contributor] elects to include this software in this distribution
    6.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    6.37 - * single choice of license, a recipient has the option to distribute
    6.38 - * your version of this file under either the CDDL, the GPL Version 2 or
    6.39 - * to extend the choice of license to its licensees as provided above.
    6.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    6.41 - * Version 2 license, then the option applies only if the new code is
    6.42 - * made subject to such option by the copyright holder.
    6.43 - */
    6.44  package apifest;
    6.45  
    6.46  import junit.framework.TestCase;
    6.47 @@ -46,6 +6,7 @@
    6.48  
    6.49  /** Write a test that works with version from day A and fails with version B.
    6.50   */
    6.51 +// BEGIN: apifest.day3.against-welltestedsolution
    6.52  public class CircuitTest extends TestCase {
    6.53      public CircuitTest(String n) {
    6.54          super(n);
    6.55 @@ -65,3 +26,4 @@
    6.56          return base.substring(last+1);
    6.57      }
    6.58  }
    6.59 +// END: apifest.day3.against-welltestedsolution