-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProp.java
More file actions
52 lines (43 loc) · 960 Bytes
/
Prop.java
File metadata and controls
52 lines (43 loc) · 960 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
41
42
43
44
45
46
47
48
49
50
51
52
/**
* @(#)Prop.java
*
*
* @author Kasun Bandara
* @version 1.00 2010/3/7
*/
package backup;
import java.util.*;
public class Prop {
public static Object set(String s, String s1){
HashMap hm = new Read().getMap();
Object o = hm.put(s,s1);
new Read().setMap(hm);
return o;
}
public static Object get(String s){
HashMap hm = new Read().getMap();
return hm.get(s);
}
public static HashMap readAll(){
return new Read().getMap();
}
public static HashMap clearAll(){
HashMap hm = new Read().getMap();
HashMap old = new HashMap();
if(hm.size()<=0){
return null;
}
else{
old = hm;
hm.clear();
new Read().setMap(hm);
}
return old;
}
public static Object remove(String s){
HashMap hm = new Read().getMap();
Object o = hm.remove(s);
new Read().setMap(hm);
return o;
}
}