Worldwind public release 0.2
[worldwind-tracker.git] / gov / nasa / worldwind / formats / rpf / RpfFrameProperties.java
blobf657a6e37c29bca4373cb8decf30c381ad444d2e
1 /*
2 Copyright (C) 2001, 2006 United States Government as represented by
3 the Administrator of the National Aeronautics and Space Administration.
4 All Rights Reserved.
5 */
6 package gov.nasa.worldwind.formats.rpf;
8 /**
9 * @author dcollins
10 * @version $Id: RpfFrameProperties.java 1762 2007-05-07 19:43:55Z dcollins $
12 public class RpfFrameProperties
14 public final RpfZone zone;
15 public final int frameNumber;
16 public final RpfDataSeries dataSeries;
17 public final RpfProducer producer;
18 public final int version;
19 // private final int hashCode;
21 public RpfFrameProperties(RpfZone zone, int frameNumber, RpfDataSeries dataSeries, RpfProducer producer,
22 int version)
24 this.zone = zone;
25 this.frameNumber = frameNumber;
26 this.dataSeries = dataSeries;
27 this.producer = producer;
28 this.version = version;
29 // this.hashCode = this.computeHash();
32 private int computeHash()
34 int hash = 0;
35 if (this.zone != null)
36 hash = 29 * hash + this.zone.hashCode();
37 if (this.dataSeries != null)
38 hash = 29 * hash + this.dataSeries.hashCode();
39 if (this.producer != null)
40 hash = 29 * hash + producer.hashCode();
41 hash = 29 * hash + version;
42 hash = 29 * hash + frameNumber;
43 return hash;
46 public boolean equals(Object o)
48 if (this == o)
49 return true;
50 if (o == null || o.getClass() != this.getClass())
51 return false;
52 final RpfFrameProperties that = (RpfFrameProperties) o;
53 if (this.zone != that.zone)
54 return false;
55 if (this.frameNumber != that.frameNumber)
56 return false;
57 if (this.dataSeries != that.dataSeries)
58 return false;
59 if (this.producer != that.producer)
60 return false;
61 if (this.version != that.version)
62 return false;
63 return true;
66 public int hashCode()
68 // return this.hashCode;
69 return this.computeHash();
72 public String toString()
74 StringBuilder sb = new StringBuilder();
75 sb.append(this.getClass().getName());
76 sb.append('[');
77 sb.append("zone=").append(this.zone);
78 sb.append(", frameNumber=").append(this.frameNumber);
79 sb.append(", dataSeries=").append(this.dataSeries);
80 sb.append(", producer=").append(this.producer);
81 sb.append(", version=").append(this.version);
82 sb.append(']');
83 return sb.toString();