KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > Filter


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui;
12
13  
14 /**
15  * Model object that represents a single entry in a filter table.
16  */

17 public class Filter {
18
19     private String JavaDoc fName;
20     private boolean fChecked;
21
22     public Filter(String JavaDoc name, boolean checked) {
23         setName(name);
24         setChecked(checked);
25     }
26
27     public String JavaDoc getName() {
28         return fName;
29     }
30
31     public void setName(String JavaDoc name) {
32         fName = name;
33     }
34
35     public boolean isChecked() {
36         return fChecked;
37     }
38
39     public void setChecked(boolean checked) {
40         fChecked = checked;
41     }
42
43     public boolean equals(Object JavaDoc o) {
44         if (o instanceof Filter) {
45             Filter other = (Filter) o;
46             if (getName().equals(other.getName())) {
47                 return true;
48             }
49         }
50         return false;
51     }
52
53     public int hashCode() {
54         return getName().hashCode();
55     }
56 }
57
Popular Tags