KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > ClasspathAttribute


1 /*******************************************************************************
2  * Copyright (c) 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.core;
12
13 import org.eclipse.jdt.core.IClasspathAttribute;
14 import org.eclipse.jdt.internal.core.util.Util;
15
16 public class ClasspathAttribute implements IClasspathAttribute {
17     
18     private String JavaDoc name;
19     private String JavaDoc value;
20     
21     public ClasspathAttribute(String JavaDoc name, String JavaDoc value) {
22         this.name = name;
23         this.value = value;
24     }
25     
26     public boolean equals(Object JavaDoc obj) {
27         if (!(obj instanceof ClasspathAttribute)) return false;
28         ClasspathAttribute other = (ClasspathAttribute) obj;
29         return this.name.equals(other.name) && this.value.equals(other.value);
30     }
31
32     public String JavaDoc getName() {
33         return this.name;
34     }
35
36     public String JavaDoc getValue() {
37         return this.value;
38     }
39     
40     public int hashCode() {
41         return Util.combineHashCodes(this.name.hashCode(), this.value.hashCode());
42     }
43     
44     public String JavaDoc toString() {
45         return this.name + "=" + this.value; //$NON-NLS-1$
46
}
47
48 }
49
Popular Tags