FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing/app/test/resources/bug1390.expected at fixJavaModeLoading · Jonham/processing · GitHub
Jonham
processing
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
processing
/
app
/
test
/
resources
/
bug1390.expected
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (45 loc) · 1.4 KB
Breadcrumbs
processing
/
app
/
test
/
resources
/
bug1390.expected
Copy path
File metadata and controls
56 lines (45 loc) · 1.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.lang.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1390 extends PApplet {
enum Operation {
@Deprecated ADD_10(10) { protected int apply(int x) { return x + y; } },
MULT_5(5) { protected int apply(int x) { return x * y; } },
@SuppressWarnings("serial") DIV_10(10) { protected int apply(int x) { return x / y; } },
SUB_8(8) { protected int apply(int x) { return x - y; } };
final int y;
Operation(int y) {
this.y = y;
}
protected abstract int apply(int x);
}
Operation operation = Operation.ADD_10;
public void setup() {
int x = 10;
println("Original:", x);
for (Operation op : Operation.values()) {
x = op.apply(x);
println(op.toString(), x);
}
x = operation.apply(x);
println(operation.toString(), x);
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1390" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
Back
|
FazBrowse Home
|
New Git URL