Commit | Line | Data |
---|---|---|
46ab8ce3 FC |
1 | /*******************************************************************************\r |
2 | * Copyright (c) 2010 Ericsson\r | |
0283f7ff | 3 | *\r |
46ab8ce3 FC |
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 | |
0283f7ff | 8 | *\r |
46ab8ce3 FC |
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 | |
a96d4804 | 18 | import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r |
46ab8ce3 | 19 | \r |
d37aaa7f FC |
20 | /**\r |
21 | * The Filter tree root node\r | |
0283f7ff | 22 | *\r |
d37aaa7f FC |
23 | * @version 1.0\r |
24 | * @author Patrick Tasse\r | |
25 | */\r | |
46ab8ce3 | 26 | public class TmfFilterRootNode extends TmfFilterTreeNode {\r |
0283f7ff FC |
27 | \r |
28 | @SuppressWarnings("javadoc")\r | |
29 | public static final String NODE_NAME = "ROOT"; //$NON-NLS-1$\r | |
30 | \r | |
46ab8ce3 FC |
31 | private static final String[] VALID_CHILDREN = {\r |
32 | TmfFilterNode.NODE_NAME\r | |
33 | };\r | |
0283f7ff FC |
34 | \r |
35 | /**\r | |
36 | * Default constructor\r | |
37 | */\r | |
46ab8ce3 FC |
38 | public TmfFilterRootNode() {\r |
39 | super(null);\r | |
40 | }\r | |
41 | \r | |
42 | @Override\r | |
43 | public String getNodeName() {\r | |
44 | return NODE_NAME;\r | |
45 | }\r | |
46 | \r | |
47 | @Override\r | |
a96d4804 | 48 | public boolean matches(ITmfEvent event) {\r |
46ab8ce3 FC |
49 | for (ITmfFilterTreeNode node : getChildren()) {\r |
50 | if (! node.matches(event)) {\r | |
51 | return false;\r | |
52 | }\r | |
53 | }\r | |
54 | return true;\r | |
55 | }\r | |
56 | \r | |
57 | @Override\r | |
58 | public List<String> getValidChildren() {\r | |
59 | return Arrays.asList(VALID_CHILDREN);\r | |
60 | }\r | |
61 | \r | |
62 | }\r |