Rename xxx.lttng to xxx.lttng.core
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / filter / model / ITmfFilterTreeNode.java
1 /*******************************************************************************
2 * Copyright (c) 2010 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Godin (copelnug@gmail.com) - Initial API
11 * Yuriy Vashchuk (yvashchuk@gmail.com) - Initial implementation
12 *******************************************************************************/
13
14 package org.eclipse.linuxtools.tmf.filter.model;
15
16 import java.util.List;
17
18 import org.eclipse.linuxtools.tmf.filter.ITmfFilter;
19
20
21 /**
22 * <h4>This is Node Interface in the Filter Tree</h4>
23 */
24 public interface ITmfFilterTreeNode extends ITmfFilter {
25
26 /**
27 * <h4>Get the parent node of current node</h4>
28 *
29 * @return The parent node (null when the node has no parent).
30 */
31 public ITmfFilterTreeNode getParent();
32
33 /**
34 * <h4>Get the current node name</h4>
35 *
36 * @return The name of the current node.
37 */
38 public String getNodeName();
39
40 /**
41 * <h4>Tell if the node has children</h4>
42 *
43 * @return True if the node has children.
44 */
45 public boolean hasChildren();
46
47 /**
48 * <h4>Return the number of children</h4>
49 *
50 * @return The number of children.
51 */
52 public int getChildrenCount();
53
54 /**
55 * <h4>Get the array of children</h4>
56 *
57 * @return The array (possibly empty) of children nodes.
58 */
59 public ITmfFilterTreeNode[] getChildren();
60
61 /**
62 * <h4>Get the node by index</h4>
63 *
64 * @param index The index of node to return.
65 * @return The desired node (null if the node is not exists).
66 */
67 public ITmfFilterTreeNode getChild(int index);
68
69 /**
70 * <h4>Remove the node from its parent</h4>
71 *
72 * <p>Shifts all nodes after the removed one to prevent having an empty spot.
73 * See {@link #replaceChildren(int, ITmfFilterTreeNode)} to replace a node.</p>
74 *
75 * @return The removed node.
76 */
77 public ITmfFilterTreeNode remove();
78
79 /**
80 * <h4>Remove the child from the current node</h4>
81 *
82 * <p>Shifts all nodes after the removed one to prevent having an empty spot.
83 * See {@link #replaceChildren(int, ITmfFilterTreeNode)} to replace a node.</p>
84 *
85 * @return The removed node.
86 */
87 public ITmfFilterTreeNode removeChild(ITmfFilterTreeNode node);
88
89 /**
90 * <h4>Append a node to the current children</h4>
91 *
92 * @param node Node to append.
93 * @return Index of added node (-1 if the node cannot be added).
94 */
95 public int addChild(ITmfFilterTreeNode node);
96
97 /**
98 * <h4>Replace a child node</h4>
99 *
100 * @param index Index of the node to replace.
101 * @param node Node who will replace.
102 * @return Node replaced.
103 */
104 public ITmfFilterTreeNode replaceChild(int index, ITmfFilterTreeNode node);
105
106 /**
107 * <h4>Sets the parent of current node</h4>
108 *
109 * @param parent The parent of current node.
110 */
111 public void setParent(ITmfFilterTreeNode parent);
112
113 /**
114 * <h4>Gets the list of valid children node names that could be added to the node</h4>
115 *
116 * @return The list of valid children node names.
117 */
118 public List<String> getValidChildren();
119
120 public ITmfFilterTreeNode clone();
121
122 }
This page took 0.043932 seconds and 5 git commands to generate.