-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhanTu.java
More file actions
40 lines (35 loc) · 971 Bytes
/
PhanTu.java
File metadata and controls
40 lines (35 loc) · 971 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
36
37
38
39
40
import java.io.File;
import java.util.*;
public class PhanTu<T> {
private <T> test;
private List<<T>> testarr = new ArrayList<>();
public <T> getTest {
return this.test;
}
public void setTest(<T> test) {
this.test = test;
}
public boolean isGreaterThan(<T> a) {
if (this.test > a)
return true;
else
return false;
}
public List<Integer> intsort(File path) {
List<T> result = new ArrayList<>();
try {
Scanner sc = new Scanner(path);
while (sc.hasNextLine()) {
result.add(sc.nextLine());
}
for (int i = 0; i < result.size(); i++) {
if (result.get(i) instanceof Integer)
continue;
else
result.delete(i);
}
} catch (FileNotFoundException e)
return -1;
return result;
}
}