Package com.storedobject.svg
Class Styles
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,String>
The Styles class extends HashMap and provides functionality for constructing
CSS style definitions. Each entry in the map represents a CSS property and its value.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
Styles
public Styles()Creates a new instance of the Styles class, which extends HashMap. This constructor initializes an empty map that will hold CSS property-value pairs for style definitions.
-
-
Method Details
-
set
Sets a property key and its corresponding value.- Parameters:
key- the name of the property to set. If the key is invalid, it will be ignored.value- the value of the property to set. Passing null removes the property.- Returns:
- the current instance of the Styles class, allowing method chaining
-
build
Constructs the style-attributes part of an element.- Returns:
- the constructed style-attributes string
-