01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/facade/AssessmentTemplateIteratorFacade.java $
03: * $Id: AssessmentTemplateIteratorFacade.java 9273 2006-05-10 22:34:28Z daisyf@stanford.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the"License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.tool.assessment.facade;
21:
22: import java.util.Collection;
23: import java.util.Iterator;
24:
25: /**
26: * A AssessmentTemplate iterator implementation.
27: *
28: * @author Rachel Gollub <rgollub@stanford.edu>
29: */
30: public class AssessmentTemplateIteratorFacade
31: //implements AssessmentTemplateIterator
32: {
33: private Iterator assessmentTemplateIter;
34: private int size = 0;
35:
36: /**
37: * Creates a new AssessmentTemplateIteratorImpl object.
38: *
39: * @param passessmentTemplates DOCUMENTATION PENDING
40: */
41: public AssessmentTemplateIteratorFacade(
42: Collection passessmentTemplates) {
43: assessmentTemplateIter = passessmentTemplates.iterator();
44: this .size = passessmentTemplates.size();
45: }
46:
47: /**
48: * DOCUMENTATION PENDING
49: *
50: * @return DOCUMENTATION PENDING
51: *
52: * @throws DataFacadeException DOCUMENTATION PENDING
53: */
54: public boolean hasNextAssessmentTemplate()
55: throws DataFacadeException {
56: try {
57: return assessmentTemplateIter.hasNext();
58: } catch (Exception e) {
59: throw new DataFacadeException("No objects to return.");
60: }
61: }
62:
63: /**
64: * DOCUMENTATION PENDING
65: *
66: * @return DOCUMENTATION PENDING
67: *
68: * @throws DataFacadeException DOCUMENTATION PENDING
69: */
70: public AssessmentTemplateFacade nextAssessmentTemplate()
71: throws DataFacadeException {
72: try {
73: return (AssessmentTemplateFacade) assessmentTemplateIter
74: .next();
75: } catch (Exception e) {
76: throw new DataFacadeException("No objects to return.");
77: }
78: }
79:
80: public int getSize() {
81: return size;
82: }
83:
84: }
|