Fix some null warnings
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / filter / model / ITmfFilterTreeNode.java
1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 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.tracecompass.tmf.core.filter.model;
15
16 import java.util.List;
17
18 import org.eclipse.jdt.annotation.NonNull;
19 import org.eclipse.tracecompass.tmf.core.filter.ITmfFilter;
20
21
22 /**
23 * <h4>This is Node Interface in the Filter Tree</h4>
24 */
25 public interface ITmfFilterTreeNode extends ITmfFilter {
26
27 /**
28 * <h4>Get the parent node of current node</h4>
29 *
30 * @return The parent node (null when the node has no parent).
31 */
32 public ITmfFilterTreeNode getParent();
33
34 /**
35 * <h4>Get the current node name</h4>
36 *
37 * @return The name of the current node.
38 */
39 public String getNodeName();
40
41 /**
42 * <h4>Tell if the node has children</h4>
43 *
44 * @return True if the node has children.
45 */
46 public boolean hasChildren();
47
48 /**
49 * <h4>Return the number of children</h4>
50 *
51 * @return The number of children.
52 */
53 public int getChildrenCount();
54
55 /**
56 * <h4>Get the array of children</h4>
57 *
58 * @return The array (possibly empty) of children nodes.
59 */
60 public @NonNull ITmfFilterTreeNode[] getChildren();
61
62 /**
63 * <h4>Get the node by index</h4>
64 *
65 * @param index The index of node to return.
66 * @return The desired node (null if the node is not exists).
67 */
68 public ITmfFilterTreeNode getChild(int index);
69
70 /**
71 * <h4>Remove the node from its parent</h4>
72 *
73 * <p>Shifts all nodes after the removed one to prevent having an empty spot.
74 * See {@link #replaceChild(int, ITmfFilterTreeNode)} to replace a node.</p>
75 *
76 * @return The removed node.
77 */
78 public ITmfFilterTreeNode remove();
79
80 /**
81 * <h4>Remove the child from the current node</h4>
82 *
83 * <p>Shifts all nodes after the removed one to prevent having an empty spot.
84 * See {@link #replaceChild(int, ITmfFilterTreeNode)} to replace a node.</p>
85 *
86 * @param node the parent node
87 *
88 * @return The removed node.
89 */
90 public ITmfFilterTreeNode removeChild(ITmfFilterTreeNode node);
91
92 /**
93 * <h4>Append a node to the current children</h4>
94 *
95 * @param node Node to append.
96 * @return Index of added node (-1 if the node cannot be added).
97 */
98 public int addChild(ITmfFilterTreeNode node);
99
100 /**
101 * <h4>Replace a child node</h4>
102 *
103 * @param index Index of the node to replace.
104 * @param node Node who will replace.
105 * @return Node replaced.
106 */
107 public ITmfFilterTreeNode replaceChild(int index, ITmfFilterTreeNode node);
108
109 /**
110 * <h4>Sets the parent of current node</h4>
111 *
112 * @param parent The parent of current node.
113 */
114 public void setParent(ITmfFilterTreeNode parent);
115
116 /**
117 * <h4>Gets the list of valid children node names that could be added to the node</h4>
118 *
119 * @return The list of valid children node names.
120 */
121 public List<String> getValidChildren();
122
123 /**
124 * <h4>Returns a string representation of the filter tree node object.</h4>
125 *
126 * @param explicit
127 * true if ambiguous fields should explicitly include additional
128 * information that can differentiate them from other fields with
129 * the same name
130 *
131 * @return a string representation of the filter tree node object
132 */
133 public String toString(boolean explicit);
134
135 /**
136 * @return a clone of the node
137 */
138 public ITmfFilterTreeNode clone();
139 }
This page took 0.04046 seconds and 5 git commands to generate.