I am newbie to Android and I am working in an Android project. I want to implement a data model, using that model I want to perform the arithmetic operations using the Hash Map.
But I don't know how to implement it. And also I want to print the value in Text View. The project is like an Calculator.
ModelActivity
Create the getter and setter I don't know how to implement this
MainActivity
Using that Model I have to perform the operation like getting and setting the value using the Hash map.
This is my model class
public class Model {
public Map<String, String> getSmap(String string, String str) {
return Smap;
}
public Map<Integer, Integer> getImap() {
return Imap;
}
public Map<String, Integer> getSImap() {
return SImap;
}
public Map<Integer, String> getISmap(String jeeva, String s) {
return ISmap;
}
private Map<String, String> Smap = new HashMap<>();
private Map<Integer, Integer> Imap = new HashMap();
private Map<String, Integer> SImap = new HashMap<>();
private Map<Integer, String> ISmap = new HashMap<>();
public Map<Integer, String> getISmap(String jeeva) {
return ISmap;
}
}
Using that model I want to perform the operations like add sub.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…