Package org.n52.io.style
Class Style
- java.lang.Object
-
- org.n52.io.style.Style
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAMETER_COLORstatic StringPARAMETER_INTERVALstatic StringVALUE_INTERVAL_BY_DAYstatic StringVALUE_INTERVAL_BY_HOURstatic StringVALUE_INTERVAL_BY_MONTHstatic StringVALUE_INTERVAL_BY_WEEK
-
Constructor Summary
Constructors Constructor Description Style()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetColor()(package private) Map<String,String>getProperties()(package private) ObjectgetProperty(String property)(package private) Object[]getPropertyAsArray(String property)(package private) booleangetPropertyAsBoolean(String property)(package private) doublegetPropertyAsDouble(String property)(package private) intgetPropertyAsInt(String property)(package private) StringgetPropertyAsString(String property)(package private) booleanhasProperty(String property)(package private) voidsetProperties(Map<String,String> properties)Sets the style properties.
-
-
-
Field Detail
-
PARAMETER_COLOR
public static final String PARAMETER_COLOR
- See Also:
- Constant Field Values
-
PARAMETER_INTERVAL
public static final String PARAMETER_INTERVAL
- See Also:
- Constant Field Values
-
VALUE_INTERVAL_BY_MONTH
public static final String VALUE_INTERVAL_BY_MONTH
- See Also:
- Constant Field Values
-
VALUE_INTERVAL_BY_WEEK
public static final String VALUE_INTERVAL_BY_WEEK
- See Also:
- Constant Field Values
-
VALUE_INTERVAL_BY_DAY
public static final String VALUE_INTERVAL_BY_DAY
- See Also:
- Constant Field Values
-
VALUE_INTERVAL_BY_HOUR
public static final String VALUE_INTERVAL_BY_HOUR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getColor
public String getColor()
- Returns:
- a 6-digit hex color. If not set a random color will be returned.
-
getPropertyAsDouble
double getPropertyAsDouble(String property)
- Parameters:
property- the property name.- Returns:
- the property value as double.
- Throws:
NullPointerException- if properties were not set (which means that default values should be expected).NumberFormatException- if property value is not a double.- See Also:
hasProperty(String)
-
getPropertyAsInt
int getPropertyAsInt(String property)
- Parameters:
property- the property name.- Returns:
- the property value as int.
- Throws:
NullPointerException- if properties were not set (which means that default values should be expected).NumberFormatException- if property value is not an integer.- See Also:
hasProperty(String)
-
getPropertyAsBoolean
boolean getPropertyAsBoolean(String property)
- Parameters:
property- the property name.- Returns:
- the property value as boolean.
- Throws:
NullPointerException- if properties were not set (which means that default values should be expected).- See Also:
hasProperty(String)
-
hasProperty
boolean hasProperty(String property)
-
setProperties
void setProperties(Map<String,String> properties)
Sets the style properties. If not set ornullthe default properties are used. However, default styles can be random values and should not be expected to be reproducable.- Parameters:
properties- style options. Ifnullor not set default values are chose.
-
-