Clover coverage report - Drools - 2.0-rc2
Coverage timestamp: Wed May 11 2005 07:12:26 BST
file stats: LOC: 112   Methods: 14
NCLOC: 62   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
EmptyMapIterator.java - 8.3% 14.3% 11.5%
coverage coverage
 1    package org.drools.util;
 2   
 3    import java.util.NoSuchElementException;
 4   
 5    /*
 6    * Copyright 2004 The Apache Software Foundation
 7    *
 8    * Licensed under the Apache License, Version 2.0 (the "License");
 9    * you may not use this file except in compliance with the License.
 10    * You may obtain a copy of the License at
 11    *
 12    * http://www.apache.org/licenses/LICENSE-2.0
 13    *
 14    * Unless required by applicable law or agreed to in writing, software
 15    * distributed under the License is distributed on an "AS IS" BASIS,
 16    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 17    * See the License for the specific language governing permissions and
 18    * limitations under the License.
 19    */
 20   
 21    /**
 22    * Provides an implementation of an empty map iterator.
 23    *
 24    * @since Commons Collections 3.1
 25    * @version $Revision: 1.4 $ $Date: 2004/12/06 01:30:38 $
 26    *
 27    * @author Stephen Colebourne
 28    */
 29    public class EmptyMapIterator
 30    implements
 31    MapIterator
 32    {
 33   
 34    /**
 35    * Singleton instance of the iterator.
 36    *
 37    * @since Commons Collections 3.1
 38    */
 39    public static final MapIterator INSTANCE = new EmptyMapIterator( );
 40   
 41    /**
 42    * Constructor.
 43    */
 44  3 protected EmptyMapIterator()
 45    {
 46    }
 47   
 48  5 public boolean hasNext()
 49    {
 50  5 return false;
 51    }
 52   
 53  0 public Object next()
 54    {
 55  0 throw new NoSuchElementException( "Iterator contains no elements" );
 56    }
 57   
 58  0 public boolean hasPrevious()
 59    {
 60  0 return false;
 61    }
 62   
 63  0 public Object previous()
 64    {
 65  0 throw new NoSuchElementException( "Iterator contains no elements" );
 66    }
 67   
 68  0 public int nextIndex()
 69    {
 70  0 return 0;
 71    }
 72   
 73  0 public int previousIndex()
 74    {
 75  0 return -1;
 76    }
 77   
 78  0 public void add( Object obj )
 79    {
 80  0 throw new UnsupportedOperationException( "add() not supported for empty Iterator" );
 81    }
 82   
 83  0 public void set( Object obj )
 84    {
 85  0 throw new IllegalStateException( "Iterator contains no elements" );
 86    }
 87   
 88  0 public void remove()
 89    {
 90  0 throw new IllegalStateException( "Iterator contains no elements" );
 91    }
 92   
 93  0 public Object getKey()
 94    {
 95  0 throw new IllegalStateException( "Iterator contains no elements" );
 96    }
 97   
 98  0 public Object getValue()
 99    {
 100  0 throw new IllegalStateException( "Iterator contains no elements" );
 101    }
 102   
 103  0 public Object setValue( Object value )
 104    {
 105  0 throw new IllegalStateException( "Iterator contains no elements" );
 106    }
 107   
 108  0 public void reset()
 109    {
 110    // do nothing
 111    }
 112    }