

package org.sakaibrary.osid.repository.xserver;

/**
 * @author Massachusetts Institute of Techbology, Sakai Software Development Team
 * @version
 */
public class PartIterator
implements org.osid.repository.PartIterator
{
    private java.util.Vector vector = new java.util.Vector();
    private int i = 0;

    public PartIterator(java.util.Vector vector)
    throws org.osid.repository.RepositoryException
    {
        this.vector = vector;
    }

    public boolean hasNextPart()
    throws org.osid.repository.RepositoryException
    {
        return i < vector.size();
    }

    public org.osid.repository.Part nextPart()
    throws org.osid.repository.RepositoryException
    {
        if (i >= vector.size())
        {
            throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
        }
        return (org.osid.repository.Part)vector.elementAt(i++);
    }
}
