Skip to content

Commit ed0fc7c

Browse files
committed
Fix indentation
1 parent 0e63666 commit ed0fc7c

File tree

5 files changed

+255
-255
lines changed

5 files changed

+255
-255
lines changed

build.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<import file="nbproject/build-impl.xml"/>
1313
<!--
1414
15-
There exist several targets which are by default empty and which can be
16-
used for execution of your tasks. These targets are usually executed
17-
before and after some main targets. They are:
15+
There exist several targets which are by default empty and which can be
16+
used for execution of your tasks. These targets are usually executed
17+
before and after some main targets. They are:
1818
1919
-pre-init: called before initialization of project properties
2020
-post-init: called after initialization of project properties
@@ -40,19 +40,19 @@
4040
</obfuscate>
4141
</target>
4242
43-
For list of available properties check the imported
44-
nbproject/build-impl.xml file.
43+
For list of available properties check the imported
44+
nbproject/build-impl.xml file.
4545
4646
4747
Another way to customize the build is by overriding existing main targets.
48-
The targets of interest are:
48+
The targets of interest are:
4949
5050
-init-macrodef-javac: defines macro for javac compilation
5151
-init-macrodef-junit: defines macro for junit execution
5252
-init-macrodef-debug: defines macro for class debugging
5353
-init-macrodef-java: defines macro for class execution
5454
-do-jar: JAR building
55-
run: execution of project
55+
run: execution of project
5656
-javadoc-build: Javadoc generation
5757
test-report: JUnit report generation
5858
@@ -64,10 +64,10 @@
6464
</exec>
6565
</target>
6666
67-
Notice that the overridden target depends on the jar target and not only on
68-
the compile target as the regular run target does. Again, for a list of available
67+
Notice that the overridden target depends on the jar target and not only on
68+
the compile target as the regular run target does. Again, for a list of available
6969
properties which you can use, check the target you are overriding in the
70-
nbproject/build-impl.xml file.
70+
nbproject/build-impl.xml file.
7171
7272
-->
7373
</project>

nbproject/build-impl.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ is divided into following sections:
2828
</condition>
2929
</fail>
3030
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
31-
<!--
31+
<!--
3232
======================
33-
INITIALIZATION SECTION
33+
INITIALIZATION SECTION
3434
======================
3535
-->
3636
<target name="-pre-init">
Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,86 @@
11
package simplejavacalculator;
22

33
public class Calculator {
4-
public enum BiOperatorModes {
5-
normal, add, minus, multiply, divide
6-
}
4+
public enum BiOperatorModes {
5+
normal, add, minus, multiply, divide
6+
}
77

8-
public enum MonoOperatorModes {
9-
square, squareRoot, oneDevidedBy, cos, sin, tan
10-
}
8+
public enum MonoOperatorModes {
9+
square, squareRoot, oneDevidedBy, cos, sin, tan
10+
}
1111

12-
private Double num1, num2;
13-
private BiOperatorModes mode = BiOperatorModes.normal;
12+
private Double num1, num2;
13+
private BiOperatorModes mode = BiOperatorModes.normal;
1414

15-
private Double calculateBiImpl() {
16-
if (mode == BiOperatorModes.normal) {
17-
return num2;
18-
}
19-
if (mode == BiOperatorModes.add) {
20-
return num1 + num2;
21-
}
22-
if (mode == BiOperatorModes.minus) {
23-
return num1 - num2;
24-
}
25-
if (mode == BiOperatorModes.multiply) {
26-
return num1 * num2;
27-
}
28-
if (mode == BiOperatorModes.divide) {
29-
return num1 / num2;
30-
}
15+
private Double calculateBiImpl() {
16+
if (mode == BiOperatorModes.normal) {
17+
return num2;
18+
}
19+
if (mode == BiOperatorModes.add) {
20+
return num1 + num2;
21+
}
22+
if (mode == BiOperatorModes.minus) {
23+
return num1 - num2;
24+
}
25+
if (mode == BiOperatorModes.multiply) {
26+
return num1 * num2;
27+
}
28+
if (mode == BiOperatorModes.divide) {
29+
return num1 / num2;
30+
}
3131

32-
// never reach
33-
throw new Error();
34-
}
32+
// never reach
33+
throw new Error();
34+
}
3535

36-
public Double calculateBi(BiOperatorModes newMode, Double num) {
37-
if (mode == BiOperatorModes.normal) {
38-
num2 = 0.0;
39-
num1 = num;
40-
mode = newMode;
41-
return Double.NaN;
42-
} else {
43-
num2 = num;
44-
num1 = calculateBiImpl();
45-
mode = newMode;
46-
return num1;
47-
}
48-
}
36+
public Double calculateBi(BiOperatorModes newMode, Double num) {
37+
if (mode == BiOperatorModes.normal) {
38+
num2 = 0.0;
39+
num1 = num;
40+
mode = newMode;
41+
return Double.NaN;
42+
} else {
43+
num2 = num;
44+
num1 = calculateBiImpl();
45+
mode = newMode;
46+
return num1;
47+
}
48+
}
4949

50-
public Double calculateEqual(Double num) {
51-
return calculateBi(BiOperatorModes.normal, num);
52-
}
50+
public Double calculateEqual(Double num) {
51+
return calculateBi(BiOperatorModes.normal, num);
52+
}
5353

54-
public Double reset() {
55-
num2 = 0.0;
56-
num1 = 0.0;
57-
mode = BiOperatorModes.normal;
54+
public Double reset() {
55+
num2 = 0.0;
56+
num1 = 0.0;
57+
mode = BiOperatorModes.normal;
5858

59-
return Double.NaN;
60-
}
59+
return Double.NaN;
60+
}
6161

62-
public Double calculateMono(MonoOperatorModes newMode, Double num) {
63-
if (newMode == MonoOperatorModes.square) {
64-
return num * num;
65-
}
66-
if (newMode == MonoOperatorModes.squareRoot) {
67-
return Math.sqrt(num);
68-
}
69-
if (newMode == MonoOperatorModes.oneDevidedBy) {
70-
return 1 / num;
71-
}
72-
if (newMode == MonoOperatorModes.cos) {
73-
return Math.cos(num);
74-
}
75-
if (newMode == MonoOperatorModes.sin) {
76-
return Math.sin(num);
77-
}
78-
if (newMode == MonoOperatorModes.tan) {
79-
return Math.tan(num);
80-
}
62+
public Double calculateMono(MonoOperatorModes newMode, Double num) {
63+
if (newMode == MonoOperatorModes.square) {
64+
return num * num;
65+
}
66+
if (newMode == MonoOperatorModes.squareRoot) {
67+
return Math.sqrt(num);
68+
}
69+
if (newMode == MonoOperatorModes.oneDevidedBy) {
70+
return 1 / num;
71+
}
72+
if (newMode == MonoOperatorModes.cos) {
73+
return Math.cos(num);
74+
}
75+
if (newMode == MonoOperatorModes.sin) {
76+
return Math.sin(num);
77+
}
78+
if (newMode == MonoOperatorModes.tan) {
79+
return Math.tan(num);
80+
}
8181

82-
// never reach
83-
throw new Error();
84-
}
82+
// never reach
83+
throw new Error();
84+
}
8585

8686
}

src/simplejavacalculator/SimpleJavaCalculator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @copyright Copyright Pierre-Henry SORIA, All Rights Reserved.
99
* @license Apache (http://www.apache.org/licenses/LICENSE-2.0)
1010
* @create 2012-03-30
11-
*
11+
*
1212
* @modifiedby Achintha Gunasekara
1313
* @modweb http://www.achinthagunasekara.com
1414
* @modemail contact@achinthagunasekara.com
@@ -18,9 +18,9 @@
1818

1919
public class SimpleJavaCalculator {
2020

21-
public static void main(String[] args) {
22-
UI uiCal = new UI();
23-
uiCal.init();
24-
}
21+
public static void main(String[] args) {
22+
UI uiCal = new UI();
23+
uiCal.init();
24+
}
2525

2626
}

0 commit comments

Comments
 (0)