|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.oopitis.weather.Feature
public class Feature
Objects of this class represent features, or data groups, of weather services. A feature is a group of data that share the same semantics; in other words, features categorize weather information. A feature is associated with a set of weather properties but it does not contain the properties. Different service providers may support different sets of properties for the same feature.
A Feature object is often
assigned to a public static final field, in other words, a Java constant.
As a constant, a feature has a constant name for users to identify the
Java identifier it is assigned to. A feature may also have a
locale-sensitive name for display.
WeatherService.CONDITIONS,
WeatherService.CONDITIONS_MINUTE,
WeatherService.CONDITIONS_HOUR,
WeatherService.CONDITIONS_DAY,
WeatherService.ALERT| Field Summary | |
|---|---|
protected java.lang.String |
resourceBundleName
The base resource bundle name from the constructor. |
protected java.lang.String |
resourceKey
The resource key from the constructor. |
| Constructor Summary | |
|---|---|
Feature(java.lang.String constantName)
Constructs a feature constant. |
|
Feature(java.lang.String constantName,
java.lang.String resourceBundleName,
java.lang.String resourceKey)
Constructs a feature constant with a locale-sensitive name from resource bundles. |
|
| Method Summary | |
|---|---|
java.lang.String |
getConstantName()
Gets the fully qualified Java name of this constant. |
WeatherPropertySet |
getProperties(WeatherService service)
Gets the list of properties associated with this feature. |
java.lang.String |
toString()
Returns the string representation for the default locale. |
java.lang.String |
toString(java.util.Locale locale)
Returns a locale-specific string representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final java.lang.String resourceBundleName
protected final java.lang.String resourceKey
| Constructor Detail |
|---|
public Feature(java.lang.String constantName)
constantName - the constant name
java.lang.NullPointerException - if the given constant name is null
public Feature(java.lang.String constantName,
java.lang.String resourceBundleName,
java.lang.String resourceKey)
constantName - the constant nameresourceBundleName - the base resource bundle nameresourceKey - the resource key
java.lang.NullPointerException - if any of the given arguments is null| Method Detail |
|---|
public WeatherPropertySet getProperties(WeatherService service)
service.getApplicableProperties(this).
service - the weather service that supports this feature
UnsupportedFeatureException - if this feature is not supported
by the given weather serviceWeatherService.getApplicableProperties(Feature)public final java.lang.String getConstantName()
public java.lang.String toString(java.util.Locale locale)
Implementation note: Subclasses that override this method
without overriding toString() must never invoke
toString() directly or indirectly in the implementation.
Doing so will result in an infinite loop and eventually a
StackOverflowError.
locale - the locale for which the string is prepared; if
null, the system default locale is used.
java.util.MissingResourceException - if a resource key and
bundle name are specified but the key is not found in any
variations or the base bundletoString()public java.lang.String toString()
this.toString(Locale.getDefault()) if the value is not null;
otherwise the constant name is returned.
toString in class java.lang.ObjecttoString(Locale),
Locale.getDefault()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||