(no commit message)
[utils] / system / general / src / test / java / org / wamblee / system / graph / MyNode.java
1 /*
2  * Copyright 2005-2010 the original author or authors.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.wamblee.system.graph;
17
18 import java.util.Arrays;
19
20 /**
21  * 
22  * @author $author$
23  * @version $Revision$
24  */
25 public class MyNode extends DefaultNode {
26     private String[] ports;
27
28     /**
29      * Creates a new MyNode object.
30      * 
31      */
32     public MyNode(String aName, String[] aPorts) {
33         super(aName);
34         ports = Arrays.copyOf(aPorts, aPorts.length);
35     }
36
37     public String[] getPorts() {
38         return Arrays.copyOf(ports, ports.length);
39     }
40
41     @Override
42     public boolean equals(Object aObj) {
43         if (!super.equals(aObj)) {
44             return false;
45         }
46         if (!(aObj instanceof MyNode)) {
47             return false;
48         }
49         return Arrays.equals(ports, ((MyNode) aObj).ports);
50     }
51
52     @Override
53     public int hashCode() {
54         return super.hashCode();
55     }
56 }