EMMA Coverage Report (generated Tue Mar 14 21:50:42 EST 2006)
[all classes][org.farng.mp3.filename]

COVERAGE SUMMARY FOR SOURCE FILE [FilenameTokenIterator.java]

nameclass, %method, %block, %line, %
FilenameTokenIterator.java0%   (0/1)0%   (0/4)0%   (0/35)0%   (0/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FilenameTokenIterator0%   (0/1)0%   (0/4)0%   (0/35)0%   (0/10)
FilenameTokenIterator (FilenameToken): void 0%   (0/1)0%   (0/9)0%   (0/4)
hasNext (): boolean 0%   (0/1)0%   (0/7)0%   (0/1)
next (): Object 0%   (0/1)0%   (0/14)0%   (0/4)
remove (): void 0%   (0/1)0%   (0/5)0%   (0/1)

1package org.farng.mp3.filename;
2 
3import java.util.Iterator;
4import java.util.NoSuchElementException;
5 
6/**
7 * This class is an iterator for the <code>FilenameToken</code> class.
8 *
9 * @author Eric Farng
10 * @version $Revision: 1.1 $
11 */
12public class FilenameTokenIterator implements Iterator {
13 
14    /**
15     * Token class that this iterator is for
16     */
17    private FilenameToken filenameToken;
18    /**
19     * if true, then the token has already been returned and this iterator is done
20     */
21    private boolean returnedToken = false;
22 
23    /**
24     * Creates a new FilenameTokenIterator object.
25     *
26     * @param filenameToken <code>FilenameToken</code> class that this iterator will iterate through.
27     */
28    public FilenameTokenIterator(final FilenameToken filenameToken) {
29        super();
30        this.filenameToken = filenameToken;
31    }
32 
33    /**
34     * Returns true if the iteration has more elements. (In other words, returns true if next would return an element
35     * rather than throwing an exception.)
36     *
37     * @return true if the iteration has more elements
38     */
39    public boolean hasNext() {
40        return !returnedToken;
41    }
42 
43    /**
44     * Returns the next element in the iteration.
45     *
46     * @return the next element in the iteration.
47     */
48    public Object next() {
49        if (!returnedToken) {
50            returnedToken = true;
51            return filenameToken;
52        }
53        throw new NoSuchElementException("Iteration has no more elements.");
54    }
55 
56    /**
57     * This method is not supported in this iterator.
58     *
59     * @throws UnsupportedOperationException This method is not supported in this iterator
60     */
61    public void remove() {
62        //todo Implement this java.util.Iterator method
63        throw new UnsupportedOperationException("Method remove() not yet implemented.");
64    }
65}

[all classes][org.farng.mp3.filename]
EMMA 2.0.5312 (C) Vladimir Roubtsov