Package org.jjazz.phrasetransform.api
Class PtProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
Special properties for PhraseTransformer.
Supported property keys are defined at construction, and they must all have a default value defined.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getCopy()
The list of properties for which a non-default value is used.getPropertyAsFloat
(String key) void
saveAsString
(List<String> keys) Save key/value pairs as a string.void
Set some properties from a saved string.void
setProperty
(String key, Boolean value) void
setProperty
(String key, Float value) void
setProperty
(String key, Integer value) setProperty
(String key, String value) Overridden to allow setting a value only for a supported key.Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, save, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Field Details
-
PROP_PROPERTY
- See Also:
-
-
Constructor Details
-
PtProperties
Create a properties object.- Parameters:
defaultProperties
- The supported keys and their default values.
-
-
Method Details
-
getCopy
-
setProperty
Overridden to allow setting a value only for a supported key.- Overrides:
setProperty
in classProperties
- Parameters:
key
- Character '=' is forbiddenvalue
- Character '=' is forbidden- Returns:
- Throws:
IllegalArgumentException
- If key is not supported, or if an illegal character was used
-
getNonDefaultValueProperties
The list of properties for which a non-default value is used.- Returns:
-
getPropertyAsInteger
-
getPropertyAsBoolean
-
getPropertyAsFloat
-
setProperty
-
setProperty
-
setProperty
-
saveAsString
Save key/value pairs as a string.Example: "key1=value1,key2=value2"
- Parameters:
keys
-- Returns:
- See Also:
-
setPropertiesFromString
Set some properties from a saved string.- Parameters:
s
-- Throws:
ParseException
- See Also:
-
addPropertyChangeListener
-
removePropertyChangeListener
-