File tree 2 files changed +47
-0
lines changed
yoonexample/src/main/java/table
2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ package table ;
2
+
3
+ import static table .SlotStatus .DELETED ;
4
+ import static table .SlotStatus .EMPTY ;
5
+ import static table .SlotStatus .INUSE ;
6
+
7
+ public class Slot <K , V > {
8
+
9
+ private K key ;
10
+ private V value ;
11
+ private SlotStatus status ;
12
+
13
+ public Slot () {
14
+ this .status = EMPTY ;
15
+ }
16
+
17
+ public void insertData (K key , V value ) {
18
+ this .key = key ;
19
+ this .value = value ;
20
+ this .status = INUSE ;
21
+ }
22
+
23
+ public V deleteData (V value ) {
24
+ V returnValue = this .value ;
25
+ this .key = null ;
26
+ this .value = null ;
27
+ this .status = DELETED ;
28
+ return returnValue ;
29
+ }
30
+
31
+ public V getValue () {
32
+ return this .value ;
33
+ }
34
+
35
+ public K getKey () {
36
+ return this .key ;
37
+ }
38
+
39
+ public SlotStatus getStatus () {
40
+ return status ;
41
+ }
42
+ }
Original file line number Diff line number Diff line change
1
+ package table ;
2
+
3
+ public enum SlotStatus {
4
+ EMPTY , DELETED , INUSE
5
+ }
You can’t perform that action at this time.
0 commit comments