Commit | Line | Data |
---|---|---|
46ab8ce3 FC |
1 | /*******************************************************************************\r |
2 | * Copyright (c) 2010 Ericsson\r | |
3 | * \r | |
4 | * All rights reserved. This program and the accompanying materials are\r | |
5 | * made available under the terms of the Eclipse Public License v1.0 which\r | |
6 | * accompanies this distribution, and is available at\r | |
7 | * http://www.eclipse.org/legal/epl-v10.html\r | |
8 | * \r | |
9 | * Contributors:\r | |
10 | * Patrick Tasse - Initial API and implementation\r | |
11 | *******************************************************************************/\r | |
12 | \r | |
6c13869b | 13 | package org.eclipse.linuxtools.tmf.core.filter.model;\r |
46ab8ce3 FC |
14 | \r |
15 | import java.util.Arrays;\r | |
16 | import java.util.List;\r | |
17 | \r | |
6c13869b | 18 | import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r |
46ab8ce3 FC |
19 | \r |
20 | \r | |
21 | public class TmfFilterRootNode extends TmfFilterTreeNode {\r | |
22 | \r | |
23 | public static final String NODE_NAME = "ROOT"; //$NON-NLS-1$\r | |
24 | \r | |
25 | private static final String[] VALID_CHILDREN = {\r | |
26 | TmfFilterNode.NODE_NAME\r | |
27 | };\r | |
28 | \r | |
29 | public TmfFilterRootNode() {\r | |
30 | super(null);\r | |
31 | }\r | |
32 | \r | |
33 | @Override\r | |
34 | public String getNodeName() {\r | |
35 | return NODE_NAME;\r | |
36 | }\r | |
37 | \r | |
38 | @Override\r | |
39 | public boolean matches(TmfEvent event) {\r | |
40 | for (ITmfFilterTreeNode node : getChildren()) {\r | |
41 | if (! node.matches(event)) {\r | |
42 | return false;\r | |
43 | }\r | |
44 | }\r | |
45 | return true;\r | |
46 | }\r | |
47 | \r | |
48 | @Override\r | |
49 | public List<String> getValidChildren() {\r | |
50 | return Arrays.asList(VALID_CHILDREN);\r | |
51 | }\r | |
52 | \r | |
53 | }\r |