-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataType.java
46 lines (36 loc) · 1.02 KB
/
DataType.java
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
/*
* DataType.java
* Version 1.0
* Jason and Nathan
* 12/4/2019
*/
import java.util.LinkedList;
public abstract class DataType<E> implements Comparable<DataType<E>>{
private String name;
private LinkedList<Folder<E>> address;
DataType(String n) {
this.name = n;
this.address = new LinkedList<Folder<E>>();
}
public String getName() {
return this.name;
}
public LinkedList<Folder<E>> getAddress() {
return this.address;
}
abstract boolean updateAddress(Folder<E> parentFolder);
@Override
public int compareTo(DataType<E> otherData) {
if(otherData.getName().charAt(0) < this.name.charAt(0)) {
return 1;
}else if(otherData.getName().charAt(0) > this.name.charAt(0)) {
return -1;
}else{
return 0;
}
}
@Override
public String toString() {
return this.name;
}
}