Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 |
|
---|
7 | namespace DistributedGA.Core.Domain {
|
---|
8 | //containts contact information of one peer
|
---|
9 | public class PeerInfo {
|
---|
10 | public int Port { get; set; }
|
---|
11 | public string IpAddress { get; set; }
|
---|
12 | public string ProblemInstance { get; set; }
|
---|
13 |
|
---|
14 | public override bool Equals(System.Object obj) {
|
---|
15 | if (obj == null) {
|
---|
16 | return false;
|
---|
17 | }
|
---|
18 |
|
---|
19 | PeerInfo p = obj as PeerInfo;
|
---|
20 | if ((System.Object)p == null) {
|
---|
21 | return false;
|
---|
22 | }
|
---|
23 |
|
---|
24 | return p.Port.Equals(this.Port) && p.IpAddress.Equals(this.IpAddress);
|
---|
25 | }
|
---|
26 | public override int GetHashCode() {
|
---|
27 | return this.IpAddress.GetHashCode();
|
---|
28 | }
|
---|
29 | }
|
---|
30 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.