-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveInt.java
More file actions
35 lines (28 loc) · 989 Bytes
/
MoveInt.java
File metadata and controls
35 lines (28 loc) · 989 Bytes
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
public class MoveInt {
public static String[] Sheets = new String[256];
public static String move(int from, int to, boolean before) {
Sheets[0] = "Sheet1";
Sheets[1] = "Sheet2";
Sheets[2] = "Sheet3";
int a = from - 1;
int b = to - 1;
String temp = "";
if((from >= 1 && from <= 256) && (to >= 1 && to <= 256)) {
if(to != from) {
if(before == true) {
temp = Sheets[a];
Sheets[a] = null;
Sheets[b - 1] = temp;
return Sheets[b - 1];
}
if(before == false) {
temp = Sheets[a];
Sheets[a] = null;
Sheets[to] = temp;
return Sheets[to];
}
}
}
return null;
}
}