diff -r 02e05defc6a0 -r 3bc4c54f4bcc samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java --- a/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java Sat Jun 14 09:56:12 2008 +0200 @@ -1,22 +1,14 @@ -/* - * Element.java - * - * Created on 12. Ĩervenec 2006, 14:14 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - package org.netbeans.apifest.boolcircuit; /** * Representation of an element in the circuit. - * The internal behaviour of the element is opaque to the API user, it can only - * be used as a building block for logical equations, using primitive operation - * factories and a factory for input pin representation. - * Elements are chained to create the logical net. The inputs to the net are - * represented by the elements created by {@link #createInput(boolean[])} - * factory method. + * The internal behaviour of the element is opaque to the API user, + * it can only be used as a building block for logical equations, + * using primitive operation factories and a factory for input + * pin representation. + * Elements are chained to create the logical net. + * The inputs to the net are represented by the elements created + * by {@link #createInput(boolean[])} factory method. */ public abstract class Element { @@ -34,7 +26,9 @@ * Creates an Element representing 2-input AND function. * */ - public static Element createAnd(final Element source1, final Element source2) { + public static Element createAnd( + final Element source1, final Element source2 + ) { return new Element() { double evaluate(double[] inputs) { return source1.evaluate(inputs) * source2.evaluate(inputs); @@ -50,7 +44,9 @@ * Creates an Element representing 2-input OR function. * */ - public static Element createOr(final Element source1, final Element source2) { + public static Element createOr( + final Element source1, final Element source2 + ) { return new Element() { double evaluate(double[] inputs) { double x = source1.evaluate(inputs); @@ -100,13 +96,17 @@ /** * Creates an Element with user-defined transfer function. */ - public static Element createGate(final Element source1, final Element source2, final Function function) { + public static Element createGate( + final Element source1, final Element source2, final Function function + ) { return new Element() { double evaluate(double[] inputs) { double x = source1.evaluate(inputs); double y = source2.evaluate(inputs); double result = function.evaluate(x, y); - if (result < 0.0 || result > 1.0) throw new InternalError("Illegal gate function"); + if (result < 0.0 || result > 1.0) { + throw new InternalError("Illegal gate function"); + } return result; }