samples/apifest1/day2/inputandoperation/src/org/netbeans/apifest/boolcircuit/NotOperation.java
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/apifest1/day2/inputandoperation/src/org/netbeans/apifest/boolcircuit/NotOperation.java Sat Jun 14 09:52:45 2008 +0200
1.3 @@ -0,0 +1,33 @@
1.4 +/*
1.5 + * NotOperation.java
1.6 + *
1.7 + * Created on July 12, 2006, 2:35 PM
1.8 + *
1.9 + * To change this template, choose Tools | Template Manager
1.10 + * and open the template in the editor.
1.11 + */
1.12 +
1.13 +package org.netbeans.apifest.boolcircuit;
1.14 +
1.15 +/**
1.16 + *
1.17 + */
1.18 +final class NotOperation extends Operation {
1.19 +
1.20 + private Input input;
1.21 +
1.22 + /** Creates a new instance of NotOperation */
1.23 + NotOperation(Input input) {
1.24 + this.input = input;
1.25 + }
1.26 +
1.27 + public boolean performBooleanOperation() {
1.28 + return !input.getBooleanValue();
1.29 + }
1.30 +
1.31 + public double performRealOperation() {
1.32 + return 1f - input.getRealValue();
1.33 + }
1.34 +
1.35 +
1.36 +}