KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > xml > dom4j > o3impl > ElementIterator


1 /*
2  * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
3  *
4  * This software is open source.
5  * See the bottom of this file for the licence.
6  *
7  * $Id: ElementIterator.java,v 1.2 2003/06/10 16:18:36 per_nyfelt Exp $
8  */

9
10 package org.ozoneDB.xml.dom4j.o3impl;
11
12 import org.dom4j.Element;
13
14 import java.util.Iterator JavaDoc;
15
16 /** <p><code>ElementIterator</code> is a filtering {@link Iterator} which
17  * filters out objects which do not implement the {@link Element}
18  * interface.</p>
19  *
20  * @author <a HREF="mailto:james.strachan@metastuff.com">James Strachan</a>
21  * @version $Revision: 1.2 $
22  */

23 public class ElementIterator extends FilterIterator {
24
25     public ElementIterator(Iterator JavaDoc proxy) {
26         super(proxy);
27     }
28
29
30     /** @return true if the given element implements the {@link Element}
31      * interface
32      */

33     protected boolean matches(Object JavaDoc element) {
34         return element instanceof Element;
35     }
36 }
37
38
39 /*
40  * Redistribution and use of this software and associated documentation
41  * ("Software"), with or without modification, are permitted provided
42  * that the following conditions are met:
43  *
44  * 1. Redistributions of source code must retain copyright
45  * statements and notices. Redistributions must also contain a
46  * copy of this document.
47  *
48  * 2. Redistributions in binary form must reproduce the
49  * above copyright notice, this list of conditions and the
50  * following disclaimer in the documentation and/or other
51  * materials provided with the distribution.
52  *
53  * 3. The name "DOM4J" must not be used to endorse or promote
54  * products derived from this Software without prior written
55  * permission of MetaStuff, Ltd. For written permission,
56  * please contact dom4j-info@metastuff.com.
57  *
58  * 4. Products derived from this Software may not be called "DOM4J"
59  * nor may "DOM4J" appear in their names without prior written
60  * permission of MetaStuff, Ltd. DOM4J is a registered
61  * trademark of MetaStuff, Ltd.
62  *
63  * 5. Due credit should be given to the DOM4J Project
64  * (http://dom4j.org/).
65  *
66  * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
67  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
68  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
69  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
70  * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
71  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
72  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
73  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
74  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
75  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
76  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
77  * OF THE POSSIBILITY OF SUCH DAMAGE.
78  *
79  * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
80  *
81  * $Id: ElementIterator.java,v 1.2 2003/06/10 16:18:36 per_nyfelt Exp $
82  */

83
Popular Tags