01: package edu.indiana.lib.osid.base.repository.http;
02:
03: /**********************************************************************************
04: * $URL: https://source.sakaiproject.org/svn/citations/tags/sakai_2-4-1/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartStructureIterator.java $
05: * $Id: PartStructureIterator.java 22657 2007-03-15 13:21:23Z jimeng@umich.edu $
06: **********************************************************************************
07: *
08: * Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan, Trustees of Indiana University,
09: * Board of Trustees of the Leland Stanford, Jr., University, and The MIT Corporation
10: *
11: * Licensed under the Educational Community License Version 1.0 (the "License");
12: * By obtaining, using and/or copying this Original Work, you agree that you have read,
13: * understand, and will comply with the terms and conditions of the Educational Community License.
14: * You may obtain a copy of the License at:
15: *
16: * http://cvs.sakaiproject.org/licenses/license_1_0.html
17: *
18: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19: * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
20: * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23: *
24: **********************************************************************************/
25: /**
26: * @author Massachusetts Institute of Techbology, Sakai Software Development Team
27: * @version
28: */
29: public class PartStructureIterator implements
30: org.osid.repository.PartStructureIterator {
31: private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils
32: .getLog(PartStructureIterator.class);
33:
34: private java.util.Vector vector = new java.util.Vector();
35: private int i = 0;
36:
37: public PartStructureIterator(java.util.Vector vector)
38: throws org.osid.repository.RepositoryException {
39: this .vector = vector;
40: }
41:
42: public boolean hasNextPartStructure()
43: throws org.osid.repository.RepositoryException {
44: return (i < vector.size());
45: }
46:
47: public org.osid.repository.PartStructure nextPartStructure()
48: throws org.osid.repository.RepositoryException {
49: if (i >= vector.size()) {
50: throw new org.osid.repository.RepositoryException(
51: org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
52: }
53: return (org.osid.repository.PartStructure) vector
54: .elementAt(i++);
55: }
56: }
|