01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/trunk/sakai/portal/presence/src/java/org/sakaiproject/tool/portal/PresenceTool.java $
03: * $Id: PresenceTool.java 632 2005-07-14 21:22:50Z janderse@umich.edu $
04: **********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan, Trustees of Indiana University,
07: * Board of Trustees of the Leland Stanford, Jr., University, and The MIT Corporation
08: *
09: * Licensed under the Educational Community License Version 1.0 (the "License");
10: * By obtaining, using and/or copying this Original Work, you agree that you have read,
11: * understand, and will comply with the terms and conditions of the Educational Community License.
12: * You may obtain a copy of the License at:
13: *
14: * http://cvs.sakaiproject.org/licenses/license_1_0.html
15: *
16: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17: * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
18: * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21: *
22: **********************************************************************************/package org.sakaiproject.component.osid.repository.registry;
23:
24: /**
25: * <p>
26: * TypeIterator implements an interface with this name in the Repository OSID.
27: * </p>
28: *
29: * @author Massachusetts Institute of Technology
30: * @version $Id: PresenceTool.java 632 2005-07-14 21:22:50Z janderse@umich.edu $
31: */
32: public class TypeIterator implements org.osid.shared.TypeIterator {
33: java.util.Iterator mIterator = null;
34:
35: /**
36: * Store away what we will return piecemeal.
37: */
38: protected TypeIterator(java.util.Vector vector)
39: throws org.osid.shared.SharedException {
40: mIterator = vector.iterator();
41: }
42:
43: /**
44: * Return whether there is another Type or not.
45: */
46: public boolean hasNextType() throws org.osid.shared.SharedException {
47: return mIterator.hasNext();
48: }
49:
50: /**
51: * Return the next Type or throw an exception if there are no more Types.
52: * The exception's message is: org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS
53: */
54: public org.osid.shared.Type nextType()
55: throws org.osid.shared.SharedException {
56: try {
57: return (org.osid.shared.Type) mIterator.next();
58: } catch (java.util.NoSuchElementException e) {
59: throw new org.osid.shared.SharedException(
60: org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
61: }
62: }
63: }
|