2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
7 package gov
.nasa
.worldwind
.util
;
11 public class PerformanceStatistic
implements Comparable
<PerformanceStatistic
>
13 public static final String ALL
= "gov.nasa.worldwind.perfstat.All";
14 public static final String FRAME_RATE
= "gov.nasa.worldwind.perfstat.FrameRate";
15 public static final String FRAME_TIME
= "gov.nasa.worldwind.perfstat.FrameTime";
16 public static final String IMAGE_TILE_COUNT
= "gov.nasa.worldwind.perfstat.ImageTileCount";
17 public static final String TERRAIN_TILE_COUNT
= "gov.nasa.worldwind.perfstat.TerrainTileCount";
18 public static final String MEMORY_CACHE
= "gov.nasa.worldwind.perfstat.MemoryCache";
20 public static final Set
<String
> ALL_STATISTICS_SET
= new HashSet
<String
>(1);
23 ALL_STATISTICS_SET
.add(PerformanceStatistic
.ALL
);
26 private final String key
;
27 private final String displayString
;
28 private final Object value
;
30 public PerformanceStatistic(String key
, String displayString
, Object value
)
33 this.displayString
= displayString
;
37 public String
getKey()
42 public String
getDisplayString()
47 public Object
getValue()
52 public int compareTo(PerformanceStatistic that
)
54 //noinspection StringEquality
55 if (this.displayString
== that
.displayString
)
58 if (this.displayString
!= null && that
.displayString
!= null)
59 return this.displayString
.compareTo(that
.displayString
);
61 return this.displayString
== null ?
-1 : 1;
64 public boolean equals(Object o
)
68 if (o
== null || getClass() != o
.getClass())
71 PerformanceStatistic that
= (PerformanceStatistic
) o
;
73 if (displayString
!= null ?
!displayString
.equals(that
.displayString
) : that
.displayString
!= null)
75 if (key
!= null ?
!key
.equals(that
.key
) : that
.key
!= null)
77 //noinspection RedundantIfStatement
78 if (value
!= null ?
!value
.equals(that
.value
) : that
.value
!= null)
87 result
= (key
!= null ? key
.hashCode() : 0);
88 result
= 31 * result
+ (displayString
!= null ? displayString
.hashCode() : 0);
89 result
= 31 * result
+ (value
!= null ? value
.hashCode() : 0);
93 public String
toString()
95 return this.displayString
+ " " + this.value
.toString();