01: package org.sakaibrary.osid.repository.xserver;
02:
03: /**********************************************************************************
04: * Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan, Trustees of Indiana University,
05: * Board of Trustees of the Leland Stanford, Jr., University, and The MIT Corporation
06: *
07: * Licensed under the Educational Community License Version 1.0 (the "License");
08: * By obtaining, using and/or copying this Original Work, you agree that you have read,
09: * understand, and will comply with the terms and conditions of the Educational Community License.
10: * You may obtain a copy of the License at:
11: *
12: * http://cvs.sakaiproject.org/licenses/license_1_0.html
13: *
14: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15: * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
16: * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19: *
20: **********************************************************************************/
21:
22: /**
23: * @author gbhatnag
24: */
25: public class PropertiesIterator implements
26: org.osid.shared.PropertiesIterator {
27: private java.util.Vector vector = new java.util.Vector();
28: private int i = 0;
29:
30: public PropertiesIterator(java.util.Vector vector)
31: throws org.osid.shared.SharedException {
32: this .vector = vector;
33: }
34:
35: public boolean hasNextProperties()
36: throws org.osid.shared.SharedException {
37: return i < vector.size();
38: }
39:
40: public org.osid.shared.Properties nextProperties()
41: throws org.osid.shared.SharedException {
42: if (i < vector.size()) {
43: return (org.osid.shared.Properties) vector.elementAt(i++);
44: } else {
45: throw new org.osid.shared.SharedException(
46: org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
47: }
48: }
49: }
|