blob: edd749f70d3ad9de3b7d64fbeae6bf1d40ccc6eb [file] [log] [blame]
Richard S. Hall930fecc2005-08-16 18:33:34 +00001/*
2 * Copyright 2005 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17package org.apache.osgi.bundle.bundlerepository;
18
19import java.util.Enumeration;
20import java.util.Iterator;
21
22public class IteratorToEnumeration implements Enumeration
23{
24 private Iterator m_iter = null;
25
26 public IteratorToEnumeration(Iterator iter)
27 {
28 m_iter = iter;
29 }
30
31 public boolean hasMoreElements()
32 {
33 if (m_iter == null)
34 return false;
35 return m_iter.hasNext();
36 }
37
38 public Object nextElement()
39 {
40 if (m_iter == null)
41 return null;
42 return m_iter.next();
43 }
44}