Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5a48144dd7b11263d3f2622d3ed23c927d019ba3 (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
/*******************************************************************************
 * Copyright (c) 2010 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.TmfEvent;


public class TmfFilterRootNode extends TmfFilterTreeNode {
	
	public static final String NODE_NAME = "ROOT"; //$NON-NLS-1$
	
	private static final String[] VALID_CHILDREN = {
		TmfFilterNode.NODE_NAME
	};
	
	public TmfFilterRootNode() {
		super(null);
	}

	@Override
	public String getNodeName() {
		return NODE_NAME;
	}

	@Override
	public boolean matches(TmfEvent event) {
		for (ITmfFilterTreeNode node : getChildren()) {
			if (! node.matches(event)) {
				return false;
			}
		}
		return true;
	}

	@Override
	public List<String> getValidChildren() {
		return Arrays.asList(VALID_CHILDREN);
	}

}

Back to the top