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";
19 public static final String PICK_TIME
= "gov.nasa.worldwind.perfstat.PickTime";
20 public static final String TEXTURE_CACHE
= "gov.nasa.worldwind.perfstat.TextureCache";
22 public static final Set
<String
> ALL_STATISTICS_SET
= new HashSet
<String
>(1);
25 ALL_STATISTICS_SET
.add(PerformanceStatistic
.ALL
);
28 private final String key
;
29 private final String displayString
;
30 private final Object value
;
32 public PerformanceStatistic(String key
, String displayString
, Object value
)
35 this.displayString
= displayString
;
39 public String
getKey()
44 public String
getDisplayString()
49 public Object
getValue()
54 public int compareTo(PerformanceStatistic that
)
56 //noinspection StringEquality
57 if (this.displayString
== that
.displayString
)
60 if (this.displayString
!= null && that
.displayString
!= null)
61 return this.displayString
.compareTo(that
.displayString
);
63 return this.displayString
== null ?
-1 : 1;
66 public boolean equals(Object o
)
70 if (o
== null || getClass() != o
.getClass())
73 PerformanceStatistic that
= (PerformanceStatistic
) o
;
75 if (displayString
!= null ?
!displayString
.equals(that
.displayString
) : that
.displayString
!= null)
77 if (key
!= null ?
!key
.equals(that
.key
) : that
.key
!= null)
79 //noinspection RedundantIfStatement
80 if (value
!= null ?
!value
.equals(that
.value
) : that
.value
!= null)
89 result
= (key
!= null ? key
.hashCode() : 0);
90 result
= 31 * result
+ (displayString
!= null ? displayString
.hashCode() : 0);
91 result
= 31 * result
+ (value
!= null ? value
.hashCode() : 0);
95 public String
toString()
97 return this.displayString
+ " " + this.value
.toString();