This project has retired. For details please refer to its Attic page.
Coverage Report
Coverage Report - org.apache.ws.scout.registry.infomodel.ExtensibleObjectImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ExtensibleObjectImpl
100%
14/14
100%
2/2
1.167
 
 1  
 /*
 2  
  * Copyright 2001-2004 The Apache Software Foundation.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *      http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 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  
  * Implements JAXR Interface.
 28  
  * For futher details, look into the JAXR API Javadoc.
 29  
  *
 30  
  * @author Anil Saldhana  <anil@apache.org>
 31  
  */
 32  1115
 public class ExtensibleObjectImpl implements ExtensibleObject
 33  
 {
 34  1115
     private Map<String,Slot> slots = new HashMap<String,Slot>();
 35  
 
 36  
     public void addSlot(Slot slot) throws JAXRException
 37  
     {
 38  26
         slots.put(slot.getName(), slot);
 39  26
     }
 40  
 
 41  
     public void addSlots(Collection slots) throws JAXRException
 42  
     {
 43  2
         for (Object slot : slots) {
 44  4
             addSlot((Slot) slot);
 45  4
         }
 46  2
     }
 47  
 
 48  
     public Slot getSlot(String slotName)
 49  
     {
 50  74
         return (Slot) slots.get(slotName);
 51  
     }
 52  
 
 53  
     public Collection<Slot> getSlots()
 54  
     {
 55  16
         return slots.values();
 56  
     }
 57  
 
 58  
     public void removeSlot(String slotName)
 59  
     {
 60  4
         slots.remove(slotName);
 61  4
     }
 62  
 
 63  
     public void removeSlots(Collection slotNames)
 64  
     {
 65  2
         slots.keySet().removeAll(slotNames);
 66  2
     }
 67  
 }