on 03-02-2007 6:55 AM
how do i add Map into another Map...
could it be done ?
for instance...
Map("userid","mgm");
Map("pwd","Abu");
is a very normal Map...
yet i want something like this
Map(JCOMap,"table");
Map(JCOMap,"structure");
Map(JCOMap,"parameterlist");
JCOMap may contains
JCOMap.put("userid","abu");
JCOMap.put("pwd","Hassan");
PLS ADVICE. ..or other method will do
yzme,
Can't understand your question.
1. If you want to add all entries from one map into another then do something like this:
final Map first = new HashMap();
first.put("user", "someone");
first.put("password", "secret");
final Map second = new HashMap(first);
second.put("sid", "ERP");
second.put("sys", "00");
This way second will contain properties "user", "password", "sid" and "sys". First 2 properties are copied from map "first".
2. If you want to have nested maps then:
final Map logonData = new HashMap();
logonData.put("user", "someone");
logonData.put("password", "secret");
final Map sysData = new HashMap();
sysData.put("sid", "ERP");
sysData.put("sys", "00");
final Map allData = new HashMap();
allData.put("logon", logonData);
allData.put("sys", sysData);
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.