Clover coverage report - Code Coverage for hivemind release 1.0
Coverage timestamp: Wed Sep 22 2004 08:05:25 EDT
file stats: LOC: 84   Methods: 8
NCLOC: 46   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ElementsProxyList.java 100% 91.7% 87.5% 90.9%
coverage coverage
 1   
 //  Copyright 2004 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.hivemind.impl;
 16   
 
 17   
 import java.util.AbstractList;
 18   
 import java.util.List;
 19   
 
 20   
 import org.apache.hivemind.HiveMind;
 21   
 import org.apache.hivemind.events.RegistryShutdownListener;
 22   
 
 23   
 /**
 24   
  * The List implementation visible to the client code. It defers
 25   
  * to another inner implementation of List; initially this is
 26   
  * a {@link org.apache.hivemind.impl.ElementsInnerProxyList}, but the
 27   
  * inner proxy replaces itself with a real List implementation containing
 28   
  * the actual configuration elements.
 29   
  *
 30   
  * @author Howard Lewis Ship
 31   
  */
 32   
 public final class ElementsProxyList extends AbstractList implements RegistryShutdownListener
 33   
 {
 34   
     private List _inner;
 35   
     private boolean _shutdown;
 36   
 
 37  91
     public void registryDidShutdown()
 38   
     {
 39  91
         _shutdown = true;
 40  91
         _inner = null;
 41   
     }
 42   
 
 43  4437
     private void checkShutdown()
 44   
     {
 45  4437
         if (_shutdown)
 46  1
             throw HiveMind.createRegistryShutdownException();
 47   
     }
 48   
 
 49  1978
     public Object get(int index)
 50   
     {
 51  1978
         checkShutdown();
 52   
 
 53  1978
         return _inner.get(index);
 54   
     }
 55   
 
 56  2459
     public int size()
 57   
     {
 58  2459
         checkShutdown();
 59   
 
 60  2458
         return _inner.size();
 61   
     }
 62   
 
 63  3
     public String toString()
 64   
     {
 65  3
         return _inner.toString();
 66   
     }
 67   
 
 68  3
     public boolean equals(Object o)
 69   
     {
 70  3
         return _inner.equals(o);
 71   
     }
 72   
 
 73  0
     public int hashCode()
 74   
     {
 75  0
         return _inner.hashCode();
 76   
     }
 77   
 
 78  1039
     public void setInner(List list)
 79   
     {
 80  1039
         _inner = list;
 81   
     }
 82   
 
 83   
 }
 84