-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathBranchIfTest.java
More file actions
57 lines (47 loc) · 1.17 KB
/
BranchIfTest.java
File metadata and controls
57 lines (47 loc) · 1.17 KB
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
57
class BranchIfTest
{
public static int ifAcmpEq(String value1, String value2)
{
return value1 != value2 ? 0 : 1;
}
public static int ifAcmpNe(String value1, String value2)
{
return value1 == value2 ? 0 : 1;
}
public static int ifIcmpEq(int value1, int value2)
{
return value1 != value2 ? 0 : 1;
}
public static int ifIcmpNe(int value1, int value2)
{
return value1 == value2 ? 0 : 1;
}
public static int ifIcmpLt(int value1, int value2)
{
return value1 >= value2 ? 0 : 1;
}
public static int ifIcmpGe(int value1, int value2)
{
return value1 < value2 ? 0 : 1;
}
public static int ifIcmpGt(int value1, int value2)
{
return value1 <= value2 ? 0 : 1;
}
public static int ifIcmpLe(int value1, int value2)
{
return value1 > value2 ? 0 : 1;
}
public static int ifLcmpGraterThan(long value1, long value2)
{
return value1 > value2 ? 0 : 1;
}
public static int ifLcmpLessThan(long value1, long value2)
{
return value1 < value2 ? 0 : 1;
}
public static int ifLcmpEqualsTo(long value1, long value2)
{
return value1 == value2 ? 0 : 1;
}
}