1 /*******************************************************************************
2 * Copyright (c) 2010, 2015 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.core
.filter
.model
;
15 import java
.util
.ArrayList
;
16 import java
.util
.Arrays
;
17 import java
.util
.List
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
22 * The Filter tree root node
25 * @author Patrick Tasse
27 public class TmfFilterRootNode
extends TmfFilterTreeNode
{
30 public static final String NODE_NAME
= "ROOT"; //$NON-NLS-1$
32 private static final String
[] VALID_CHILDREN
= {
33 TmfFilterNode
.NODE_NAME
39 public TmfFilterRootNode() {
44 public String
getNodeName() {
49 public boolean matches(ITmfEvent event
) {
50 for (ITmfFilterTreeNode node
: getChildren()) {
51 if (! node
.matches(event
)) {
59 public List
<String
> getValidChildren() {
60 return Arrays
.asList(VALID_CHILDREN
);
64 public String
toString(boolean explicit
) {
65 StringBuffer buf
= new StringBuffer("root"); //$NON-NLS-1$
66 if (getChildrenCount() > 0) {
68 List
<String
> strings
= new ArrayList
<>();
69 for (ITmfFilterTreeNode child
: getChildren()) {
70 strings
.add(child
.toString(explicit
));
72 buf
.append(strings
.toString());
74 return buf
.toString();
This page took 0.032997 seconds and 5 git commands to generate.