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: 89   Methods: 7
NCLOC: 50   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ElementsInnerProxyList.java 50% 77.8% 85.7% 72.7%
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    /**
 21    * Implements a {@link java.util.List} as a proxy to an actual list of
 22    * elements, provided by an extension point. The proxy is unmodifiable
 23    * and will work with the extension point to generate the real list
 24    * of elements in a just-in-time manner.
 25    *
 26    * @author Howard Lewis Ship
 27    */
 28    public final class ElementsInnerProxyList extends AbstractList
 29    {
 30    private List _inner;
 31    private ConfigurationPointImpl _point;
 32    private ElementsProxyList _outer;
 33   
 34  533 ElementsInnerProxyList(ConfigurationPointImpl point, ElementsProxyList outer)
 35    {
 36  533 _point = point;
 37  533 _outer = outer;
 38   
 39  533 _outer.setInner(this);
 40    }
 41   
 42  529 private synchronized List inner()
 43    {
 44  529 if (_inner == null)
 45    {
 46  529 _inner = _point.constructElements();
 47   
 48    // Replace ourselves in the outer proxy with the actual list.
 49  526 _outer.setInner(_inner);
 50    }
 51   
 52  526 return _inner;
 53    }
 54   
 55  2 public Object get(int index)
 56    {
 57  2 return inner().get(index);
 58    }
 59   
 60  526 public int size()
 61    {
 62  526 return inner().size();
 63    }
 64   
 65  1 public boolean equals(Object o)
 66    {
 67  1 if (this == o)
 68  0 return true;
 69   
 70  1 if (o == null)
 71  0 return false;
 72   
 73  1 return inner().equals(o);
 74    }
 75   
 76  0 public int hashCode()
 77    {
 78  0 return inner().hashCode();
 79    }
 80   
 81  1 public synchronized String toString()
 82    {
 83  1 if (_inner != null)
 84  0 return _inner.toString();
 85   
 86  1 return "<Element List Proxy for " + _point.getExtensionPointId() + ">";
 87    }
 88   
 89    }