KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > tree > AndNodeFilter


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.tree;
14
15 import java.util.ArrayList JavaDoc;
16 import java.util.Iterator JavaDoc;
17
18 /**
19  * implements the AND function for NodeFilter
20  */

21 public class AndNodeFilter extends ArrayList JavaDoc implements NodeFilter {
22   public boolean accept(Object JavaDoc node) {
23     for (Iterator JavaDoc it = iterator(); it.hasNext();)
24       if (!((NodeFilter) it.next()).accept(node))
25         return false;
26     return true;
27   }
28 }
29
Popular Tags