1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.apache.ws.scout.registry.infomodel; |
17 | |
|
18 | |
import java.util.Collection; |
19 | |
import java.util.HashMap; |
20 | |
import java.util.Map; |
21 | |
|
22 | |
import javax.xml.registry.JAXRException; |
23 | |
import javax.xml.registry.infomodel.ExtensibleObject; |
24 | |
import javax.xml.registry.infomodel.Slot; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public class ExtensibleObjectImpl implements ExtensibleObject |
33 | |
{ |
34 | 0 | private Map<String,Slot> slots = new HashMap<String,Slot>(); |
35 | |
|
36 | |
public void addSlot(Slot slot) throws JAXRException |
37 | |
{ |
38 | 0 | slots.put(slot.getName(), slot); |
39 | 0 | } |
40 | |
|
41 | |
public void addSlots(Collection slots) throws JAXRException |
42 | |
{ |
43 | 0 | for (Object slot : slots) { |
44 | 0 | addSlot((Slot) slot); |
45 | |
} |
46 | 0 | } |
47 | |
|
48 | |
public Slot getSlot(String slotName) |
49 | |
{ |
50 | 0 | return (Slot) slots.get(slotName); |
51 | |
} |
52 | |
|
53 | |
public Collection<Slot> getSlots() |
54 | |
{ |
55 | 0 | return slots.values(); |
56 | |
} |
57 | |
|
58 | |
public void removeSlot(String slotName) |
59 | |
{ |
60 | 0 | slots.remove(slotName); |
61 | 0 | } |
62 | |
|
63 | |
public void removeSlots(Collection slotNames) |
64 | |
{ |
65 | 0 | slots.keySet().removeAll(slotNames); |
66 | 0 | } |
67 | |
} |