diff -r 02e05defc6a0 -r 3bc4c54f4bcc samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java --- a/samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java Sat Jun 14 09:56:12 2008 +0200 @@ -1,22 +1,3 @@ -/* - * The contents of this file are subject to the terms of the Common Development - * and Distribution License (the License). You may not use this file except in - * compliance with the License. - * - * You can obtain a copy of the License at http://www.netbeans.org/cddl.html - * or http://www.netbeans.org/cddl.txt. - * - * When distributing Covered Code, include this CDDL Header Notice in each file - * and include the License file at http://www.netbeans.org/cddl.txt. - * If applicable, add the following below the CDDL Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - */ - package org.netbeans.apifest.boolcircuit; // BEGIN: apifest.day2.elementbasedsolution.Circuit @@ -40,7 +21,8 @@ return e1.result() || e2.result(); } public double doubleResult() { - return 1.0 - (1.0 - e1.doubleResult()) * (1.0 - e2.doubleResult()); + return 1.0 - + (1.0 - e1.doubleResult()) * (1.0 - e2.doubleResult()); } }; } @@ -56,7 +38,9 @@ }; } - public static Element operation(final Operation op, final Element... elements) { + public static Element operation( + final Operation op, final Element... elements + ) { return new Element() { public boolean result() { return doubleResult() >= 1.0; @@ -99,11 +83,13 @@ } public boolean result() { - return booleanValue != null ? booleanValue : doubleValue >= 1.0; + return booleanValue != null ? + booleanValue : doubleValue >= 1.0; } public double doubleResult() { - return doubleValue != null ? doubleValue : (booleanValue ? 1.0 : 0.0); + return doubleValue != null ? + doubleValue : (booleanValue ? 1.0 : 0.0); } }