intial source from http://www.sf.net/projects/wdte
[phpeclipse.git] / net.sourceforge.phpeclipse.webbrowser / src / net / sourceforge / phpeclipse / webbrowser / internal / Favorite.java
1 /**
2  * Copyright (c) 2003 IBM Corporation and others.
3  * All rights reserved.   This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  *    IBM - Initial API and implementation
10  */
11 package net.sourceforge.phpeclipse.webbrowser.internal;
12 /**
13  * 
14  */
15 public class Favorite {
16         protected String url;
17         protected String name;
18
19         public Favorite() { }
20         
21         public Favorite(String name, String url) {
22                 if (name == null)
23                         name = "";
24                 if (url == null)
25                         url = "";
26                 this.name = name;
27                 this.url = url;
28         }
29
30         public String getName() {
31                 return name;
32         }
33
34         public void setName(String name) {
35                 this.name = name;
36         }
37
38         public String getURL() {
39                 return url;
40         }
41
42         public void setURL(String url) {
43                 this.url = url;
44         }
45         
46         public boolean equals(Object obj) {
47                 if (!(obj instanceof Favorite))
48                         return false;
49                 
50                 Favorite f = (Favorite) obj;
51                 return (name.equals(f.name) && url.equals(f.url));
52         }
53         
54         public String toString() {
55                 return "(" + name + "/" + url + ")";
56         }
57 }