2 Copyright (C) 2001, 2006 United States Government as represented by
3 the Administrator of the National Aeronautics and Space Administration.
6 package gov
.nasa
.worldwind
.formats
.rpf
;
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
,
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()
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
;
46 public boolean equals(Object o
)
50 if (o
== null || o
.getClass() != this.getClass())
52 final RpfFrameProperties that
= (RpfFrameProperties
) o
;
53 if (this.zone
!= that
.zone
)
55 if (this.frameNumber
!= that
.frameNumber
)
57 if (this.dataSeries
!= that
.dataSeries
)
59 if (this.producer
!= that
.producer
)
61 if (this.version
!= that
.version
)
68 // return this.hashCode;
69 return this.computeHash();
72 public String
toString()
74 StringBuilder sb
= new StringBuilder();
75 sb
.append(this.getClass().getName());
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
);