Project

General

Profile

Download (1.13 KB) Statistics
| Branch: | Tag: | Revision:
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2010 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.draw2d.graph;
12

    
13
/**
14
 * @author hudsonr
15
 * @since 2.1
16
 */
17
class NodePair {
18

    
19
	public Node n1;
20
	public Node n2;
21

    
22
	public NodePair() {
23
	}
24

    
25
	public NodePair(Node n1, Node n2) {
26
		this.n1 = n1;
27
		this.n2 = n2;
28
	}
29

    
30
	public boolean equals(Object obj) {
31
		if (obj instanceof NodePair) {
32
			NodePair np = (NodePair) obj;
33
			return np.n1 == n1 && np.n2 == n2;
34
		}
35
		return false;
36
	}
37

    
38
	public int hashCode() {
39
		return n1.hashCode() ^ n2.hashCode();
40
	}
41

    
42
	/**
43
	 * @see java.lang.Object#toString()
44
	 */
45
	public String toString() {
46
		return "[" + n1 + ", " + n2 + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
47
	}
48

    
49
}
(27-27/49)