2009/04/15 - Apache HiveMind has been retired.

For more information, please explore the Attic.

Clover coverage report - Code Coverage for hivemind release 1.2.1
Coverage timestamp: Fri Feb 10 2006 16:33:43 PST
file stats: LOC: 83   Methods: 8
NCLOC: 46   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ElementsProxyList.java 100% 91.7% 87.5% 90.9%
coverage coverage
 1    // Copyright 2004, 2005 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  113 public void registryDidShutdown()
 38    {
 39  113 _shutdown = true;
 40  113 _inner = null;
 41    }
 42   
 43  4752 private void checkShutdown()
 44    {
 45  4752 if (_shutdown)
 46  1 throw HiveMind.createRegistryShutdownException();
 47    }
 48   
 49  2130 public Object get(int index)
 50    {
 51  2130 checkShutdown();
 52   
 53  2130 return _inner.get(index);
 54    }
 55   
 56  2622 public int size()
 57    {
 58  2622 checkShutdown();
 59   
 60  2621 return _inner.size();
 61    }
 62   
 63  2 public String toString()
 64    {
 65  2 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  1059 public void setInner(List list)
 79    {
 80  1059 _inner = list;
 81    }
 82   
 83    }