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