/*
* Copyright 2003-2010 Tufts University Licensed under the
* Educational Community License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may
* obtain a copy of the License at
*
* http://www.osedu.org/licenses/ECL-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS"
* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package edu.tufts.vue.util;
/**
Simple implementation to allow sequential access
*/
public class ObjectIterator
implements org.osid.shared.ObjectIterator
{
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
public ObjectIterator(java.util.Vector vector)
throws org.osid.shared.SharedException
{
this.vector = vector;
}
public boolean hasNextObject()
throws org.osid.shared.SharedException
{
return i < vector.size();
}
public java.io.Serializable nextObject()
throws org.osid.shared.SharedException
{
if (i < vector.size())
{
return (java.io.Serializable)vector.elementAt(i++);
}
else
{
throw new org.osid.shared.SharedException(org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
}
}
/**
* <p>
* MIT O.K.I. SID Definition License.
* </p>
*
* <p>
* <b>Copyright and license statement:</b>
* </p>
*
* <p>
* Copyright © 2003 Massachusetts Institute of Technology <or
* copyright holder>
* </p>
*
* <p>
* This work is being provided by the copyright holder(s) subject to
* the terms of the O.K.I. SID Definition License. By obtaining,
* using and/or copying this Work, you agree that you have read,
* understand, and will comply with the O.K.I. SID Definition
* License.
* </p>
*
* <p>
* THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL MASSACHUSETTS INSTITUTE OF
* TECHNOLOGY, THE AUTHORS, OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK.
* </p>
*
* <p>
* <b>O.K.I. SID Definition License</b>
* </p>
*
* <p>
* This work (the “Work”), including any software,
* documents, or other items related to O.K.I. SID definitions, is
* being provided by the copyright holder(s) subject to the terms of
* the O.K.I. SID Definition License. By obtaining, using and/or
* copying this Work, you agree that you have read, understand, and
* will comply with the following terms and conditions of the
* O.K.I. SID Definition License:
* </p>
*
* <p>
* You may use, copy, and distribute unmodified versions of this Work
* for any purpose, without fee or royalty, provided that you include
* the following on ALL copies of the Work that you make or
* distribute:
* </p>
*
* <ul>
* <li>
* The full text of the O.K.I. SID Definition License in a location
* viewable to users of the redistributed Work.
* </li>
* </ul>
*
*
* <ul>
* <li>
* Any pre-existing intellectual property disclaimers, notices, or terms
* and conditions. If none exist, a short notice similar to the following
* should be used within the body of any redistributed Work:
* “Copyright © 2003 Massachusetts Institute of Technology. All
* Rights Reserved.”
* </li>
* </ul>
*
* <p>
* You may modify or create Derivatives of this Work only for your
* internal purposes. You shall not distribute or transfer any such
* Derivative of this Work to any location or any other third party.
* For purposes of this license, “Derivative” shall mean
* any derivative of the Work as defined in the United States
* Copyright Act of 1976, such as a translation or modification.
* </p>
*
* <p>
* THE WORK PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL MASSACHUSETTS INSTITUTE OF
* TECHNOLOGY, THE AUTHORS, OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK.
* </p>
*
* <p>
* The name and trademarks of copyright holder(s) and/or O.K.I. may
* NOT be used in advertising or publicity pertaining to the Work
* without specific, written prior permission. Title to copyright in
* the Work and any associated documentation will at all times remain
* with the copyright holders.
* </p>
*
* <p>
* The export of software employing encryption technology may require a
* specific license from the United States Government. It is the
* responsibility of any person or organization contemplating export
* to obtain such a license before exporting this Work.
* </p>
*/
}