BaseAdapter.java
2.14 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.sw.laryngoscope.FHIR.adapter;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.sw.laryngoscope.FHIR.model.PatientModel;
import java.util.ArrayList;
import java.util.HashMap;
public abstract class BaseAdapter<H extends BaseViewHolder> extends RecyclerView.Adapter<BaseViewHolder> {
private HashMap<String, PatientModel> patientsHashMap;
private ArrayList<PatientModel> uniquePatients = new ArrayList<>();
/**
* Constructor.
*/
BaseAdapter(HashMap<String, PatientModel> patientsHashMap) {
this.patientsHashMap = patientsHashMap;
}
/**
* Getter for PatientHashMap
* @return the patientHashMap
*/
HashMap<String, PatientModel> getPatientsHashMap() {
return patientsHashMap;
}
/**
* Setter for PatientHashMap
* @param patientsHashMap new PatientHashMap
*/
void setPatientsHashMap(HashMap<String, PatientModel> patientsHashMap) {
this.patientsHashMap = patientsHashMap;
}
/**
* Getter for uniquePatients
* @return uniquePatients
*/
ArrayList<PatientModel> getUniquePatients() {
return uniquePatients;
}
/**
* Setter for uniquePatients
* @param uniquePatients new uniquePatients list
*/
void setUniquePatients(ArrayList<PatientModel> uniquePatients) {
this.uniquePatients = uniquePatients;
}
/**
* onCreateViewHolder overrides it superclass's ( RecyclerView ) method
* subclass of this class must implement this method.
*/
@NonNull
@Override
public abstract BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType);
/**
* onBindViewHolder overrides it superclass's ( RecyclerView ) method
* subclass of this class must implement this method.
*/
@Override
public abstract void onBindViewHolder(@NonNull BaseViewHolder holder, int position);
/**
* onGetItemCount overrides it superclass's ( RecyclerView ) method
* subclass of this class must implement this method.
*/
@Override
public abstract int getItemCount();
}