24
24
@SuppressWarnings("javadoc")
25
25
public class TmfFilterAndNode extends TmfFilterTreeNode {
27
public static final String NODE_NAME = "AND"; //$NON-NLS-1$
28
public static final String NOT_ATTR = "not"; //$NON-NLS-1$
30
private boolean fNot = false;
33
* @param parent the parent node
35
public TmfFilterAndNode(ITmfFilterTreeNode parent) {
40
* @return the NOT state
42
public boolean isNot() {
47
* @param not the NOT state
49
public void setNot(boolean not) {
54
public String getNodeName() {
59
public boolean matches(ITmfEvent event) {
60
for (ITmfFilterTreeNode node : getChildren()) {
61
if (! node.matches(event)) {
69
public String toString() {
70
StringBuffer buf = new StringBuffer();
72
buf.append("not "); //$NON-NLS-1$
74
if (getParent() != null && !(getParent() instanceof TmfFilterRootNode) && !(getParent() instanceof TmfFilterNode)) {
75
buf.append("( "); //$NON-NLS-1$
77
for (int i = 0; i < getChildrenCount(); i++) {
78
ITmfFilterTreeNode node = getChildren()[i];
79
buf.append(node.toString());
80
if (i < getChildrenCount() - 1) {
81
buf.append(" and "); //$NON-NLS-1$
84
if (getParent() != null && !(getParent() instanceof TmfFilterRootNode) && !(getParent() instanceof TmfFilterNode)) {
85
buf.append(" )"); //$NON-NLS-1$
87
return buf.toString();
27
public static final String NODE_NAME = "AND"; //$NON-NLS-1$
28
public static final String NOT_ATTR = "not"; //$NON-NLS-1$
30
private boolean fNot = false;
33
* @param parent the parent node
35
public TmfFilterAndNode(ITmfFilterTreeNode parent) {
40
* @return the NOT state
42
public boolean isNot() {
47
* @param not the NOT state
49
public void setNot(boolean not) {
54
public String getNodeName() {
59
public boolean matches(ITmfEvent event) {
60
for (ITmfFilterTreeNode node : getChildren()) {
61
if (! node.matches(event)) {
69
public String toString() {
70
StringBuffer buf = new StringBuffer();
72
buf.append("not "); //$NON-NLS-1$
74
if (getParent() != null && !(getParent() instanceof TmfFilterRootNode) && !(getParent() instanceof TmfFilterNode)) {
75
buf.append("( "); //$NON-NLS-1$
77
for (int i = 0; i < getChildrenCount(); i++) {
78
ITmfFilterTreeNode node = getChildren()[i];
79
buf.append(node.toString());
80
if (i < getChildrenCount() - 1) {
81
buf.append(" and "); //$NON-NLS-1$
84
if (getParent() != null && !(getParent() instanceof TmfFilterRootNode) && !(getParent() instanceof TmfFilterNode)) {
85
buf.append(" )"); //$NON-NLS-1$
87
return buf.toString();
91
public int hashCode() {
93
int result = super.hashCode();
94
result = prime * result + (fNot ? 1231 : 1237);
99
public boolean equals(Object obj) {
103
if (!super.equals(obj)) {
106
if (getClass() != obj.getClass()) {
109
TmfFilterAndNode other = (TmfFilterAndNode) obj;
110
if (fNot != other.fNot) {