Clover coverage report - Code Coverage for tapestry-contrib release 4.0.2
Coverage timestamp: Thu Apr 13 2006 10:55:19 EDT
file stats: LOC: 78   Methods: 5
NCLOC: 41   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ArrayIterator.java 0% 0% 0% 0%
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.tapestry.contrib.table.model.common;
 16   
 17    import java.util.Iterator;
 18    import java.util.NoSuchElementException;
 19   
 20    /**
 21    * @author mindbridge
 22    */
 23    public class ArrayIterator implements Iterator
 24    {
 25    private Object[] m_arrValues;
 26    private int m_nFrom;
 27    private int m_nTo;
 28    private int m_nCurrent;
 29   
 30  0 public ArrayIterator(Object[] arrValues)
 31    {
 32  0 this(arrValues, 0, arrValues.length);
 33    }
 34   
 35  0 public ArrayIterator(Object[] arrValues, int nFrom, int nTo)
 36    {
 37  0 m_arrValues = arrValues;
 38  0 m_nFrom = nFrom;
 39  0 m_nTo = nTo;
 40   
 41  0 if (m_nFrom < 0)
 42  0 m_nFrom = 0;
 43  0 if (m_nTo < m_nFrom)
 44  0 m_nTo = m_nFrom;
 45  0 if (m_nTo > m_arrValues.length)
 46  0 m_nTo = m_arrValues.length;
 47   
 48  0 m_nCurrent = m_nFrom;
 49    }
 50   
 51    /**
 52    * @see java.util.Iterator#hasNext()
 53    */
 54  0 public boolean hasNext()
 55    {
 56  0 return m_nCurrent < m_nTo;
 57    }
 58   
 59    /**
 60    * @see java.util.Iterator#next()
 61    */
 62  0 public Object next()
 63    {
 64    //System.out.println("index: " + m_nCurrent + " size: " + m_arrValues.length + " to: " + m_nTo);
 65  0 if (!hasNext())
 66  0 throw new NoSuchElementException();
 67  0 return m_arrValues[m_nCurrent++];
 68    }
 69   
 70    /**
 71    * @see java.util.Iterator#remove()
 72    */
 73  0 public void remove()
 74    {
 75  0 throw new UnsupportedOperationException();
 76    }
 77   
 78    }