Package org.svvrl.goal.core
Class Properties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
org.svvrl.goal.core.Properties
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.Object,java.lang.Object>
- Direct Known Subclasses:
CouvreurOptions
,ExtendedGPVWOptions
,ExtendedGPVWPlusOptions
,ExtendedLTL2AUTOptions
,ExtendedLTL2AUTPlusOptions
,IncrementalTableauOptions
,LTL2BAOptions
,LTL2BuchiOptions
,ModellaOptions
,MSContainmentOptions
,NTGBW2NBWOptions
,ORETranslationOptions
,PitermanContainmentOptions
,PLTL2BAOptions
,PruningFairSetsOptions
,QPTL2BAOptions
,RamseyOptions
,RETranslationOptions
,SafraContainmentOptions
,SimulationOptimizerOptions
,SliceVWOptions
,TableauOptions
,TemporalTesterOptions
public class Properties
extends java.util.Properties
A
Properties
object extends java.util.Properties
by
adding some useful methods for retrieving string properties. Methods
inherited from java.util.Hashtable
remain unchanged.
By default, when the value of a name is not found in a Properties
object, the value of the name in Preference
will be returned. To
forbid the lookup in Preference
, pass false
to
Properties(boolean)
,
Properties(java.util.Properties, boolean)
, or
setPreferenceLookup(boolean)
.- Author:
- Ming-Hsien Tsai
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.beans.PropertyChangeListener>
listeners
A list of listeners that are interested in the change of the properties.static java.lang.String
PROPERTY_DELIMITER
The delimiter of values within a property. -
Constructor Summary
Constructors Constructor Description Properties()
Constructs this object with empty properties.Properties(boolean pref)
Constructs this object with empty propertiesProperties(java.util.Properties o)
Constructs this object with predefined properties.Properties(java.util.Properties o, boolean pref)
Constructs this object with predefined properties. -
Method Summary
Modifier and Type Method Description void
addProperties(java.util.Properties o)
Inserts a set of properties.void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers a listener that is interested in the change of this properties.void
appendProperties(java.util.Properties o)
Appends all string properties of a specifiedProperties
object to this object with a default delimiterPROPERTY_DELIMITER
.void
appendProperties(java.util.Properties o, java.lang.String delim)
Appends all string properties of a specifiedProperties
objecto
to this object.protected void
firePropertyChangeEvent(java.beans.PropertyChangeEvent evt)
Sends a property change event to all registered property change listeners.java.lang.String
getProperty(java.lang.String name)
Returns the property in this object as a string.int
getProperty(java.lang.String name, int def)
Returns the property in this object as a string.java.lang.String
getProperty(java.lang.String name, java.lang.String def)
Returns the property in this object as a string.boolean
getPropertyAsBoolean(java.lang.String name)
Returns the property as a Boolean.boolean
getPropertyAsBoolean(java.lang.String name, boolean def)
Returns the property as a Boolean.double
getPropertyAsDouble(java.lang.String name)
Returns the property as a double precision floating-point number.double
getPropertyAsDouble(java.lang.String name, double def)
Returns the property as a double precision floating-point number.int
getPropertyAsInteger(java.lang.String name)
Returns the property as an integer.int
getPropertyAsInteger(java.lang.String name, int def)
Returns the property as an integer.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters a listener that was interested in the change of this properties.void
setPreferenceLookup(boolean pref)
Setstrue
to allow the lookup of a name inPreference
when the name is not found in this object.void
setProperty(java.lang.String name, boolean b)
Sets a Boolean property.void
setProperty(java.lang.String name, double d)
Sets a property with a double precision floating-point number.void
setProperty(java.lang.String name, int i)
Sets an integer property.java.lang.Object
setProperty(java.lang.String name, java.lang.String value)
Sets a property.Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Field Details
-
PROPERTY_DELIMITER
public static final java.lang.String PROPERTY_DELIMITERThe delimiter of values within a property.- See Also:
- Constant Field Values
-
listeners
protected java.util.List<java.beans.PropertyChangeListener> listenersA list of listeners that are interested in the change of the properties.
-
-
Constructor Details
-
Properties
public Properties()Constructs this object with empty properties. When a name is not found in this object, this object will look for the name inPreference
. -
Properties
public Properties(boolean pref)Constructs this object with empty properties- Parameters:
pref
-true
to look for a name inPreference
when the name is not found in this object
-
Properties
public Properties(java.util.Properties o)Constructs this object with predefined properties.- Parameters:
o
- the predefined properties
-
Properties
public Properties(java.util.Properties o, boolean pref)Constructs this object with predefined properties.- Parameters:
o
- the predefined propertiespref
-true
to look for a name inPreference
when the name is not found in this object
-
-
Method Details
-
setPreferenceLookup
public void setPreferenceLookup(boolean pref)Setstrue
to allow the lookup of a name inPreference
when the name is not found in this object.- Parameters:
pref
-true
to look for a name inPreference
when the name is not found in this object
-
addProperties
public void addProperties(java.util.Properties o)Inserts a set of properties. Property change event will be sent at the end of this method.- Parameters:
o
- the properties to be added
-
appendProperties
public void appendProperties(java.util.Properties o)Appends all string properties of a specifiedProperties
object to this object with a default delimiterPROPERTY_DELIMITER
.- Parameters:
o
- a properties object
-
appendProperties
public void appendProperties(java.util.Properties o, java.lang.String delim)Appends all string properties of a specifiedProperties
objecto
to this object. If a string propertyprop
ofo
is also contained in this object, the new value of the property in this object will becomegetProperty(prop)
+delim
+o.getProperty(prop)
. If the property is not in this object, it will be added to this object.- Parameters:
o
- a properties objectdelim
- a delimiter
-
setProperty
public java.lang.Object setProperty(java.lang.String name, java.lang.String value)Sets a property. Removes the property if the argumentvalue
is null.- Overrides:
setProperty
in classjava.util.Properties
- Parameters:
name
- the name of the propertyvalue
- the value of the property- Returns:
- the previous value of the property
-
getProperty
public java.lang.String getProperty(java.lang.String name)Returns the property in this object as a string. If the property in this object is not set, the value found in the user preference will be returned. Returnsnull
if the property cannot be found in the user preference.- Overrides:
getProperty
in classjava.util.Properties
-
setProperty
public void setProperty(java.lang.String name, boolean b)Sets a Boolean property.- Parameters:
name
- the name of the propertyb
- the Boolean value of the property
-
setProperty
public void setProperty(java.lang.String name, int i)Sets an integer property.- Parameters:
name
- the name of the propertyi
- the integer value of the property
-
setProperty
public void setProperty(java.lang.String name, double d)Sets a property with a double precision floating-point number.- Parameters:
name
- the name of the propertyd
- the value of the property
-
getProperty
public java.lang.String getProperty(java.lang.String name, java.lang.String def)Returns the property in this object as a string. If the property in this object is not set, the value found in the user preference will be returned. Returns the second argumentdef
if the property cannot be found in the user preference.- Overrides:
getProperty
in classjava.util.Properties
- Parameters:
name
- the name of the propertydef
- the default value of the property- Returns:
- the value of the property
-
getProperty
public int getProperty(java.lang.String name, int def)Returns the property in this object as a string. If the property in this object is not set, the value found in the user preference will be returned. Returns the second argumentdef
if the property cannot be found in the user preference.- Parameters:
name
- the name of the propertydef
- the default value of the property- Returns:
- the value of the property
-
getPropertyAsBoolean
public boolean getPropertyAsBoolean(java.lang.String name)Returns the property as a Boolean.- Parameters:
name
- the name of the property- Returns:
- the Boolean value of the property
- See Also:
getProperty(String)
-
getPropertyAsBoolean
public boolean getPropertyAsBoolean(java.lang.String name, boolean def)Returns the property as a Boolean. If the property is not set or incorrectly set, the default valuedef
will be returned.- Parameters:
name
- the name of the propertydef
- the default value- Returns:
- the Boolean value of the property
- See Also:
getProperty(String)
-
getPropertyAsInteger
public int getPropertyAsInteger(java.lang.String name)Returns the property as an integer.- Parameters:
name
- the name of the property- Returns:
- the integer value of the property
- See Also:
getProperty(String)
-
getPropertyAsInteger
public int getPropertyAsInteger(java.lang.String name, int def)Returns the property as an integer. If the property is not set or incorrectly set, the default valuedef
will be returned.- Parameters:
name
- the name of the propertydef
- the default value of the property- Returns:
- the integer value of the property
- See Also:
getProperty(String)
-
getPropertyAsDouble
public double getPropertyAsDouble(java.lang.String name)Returns the property as a double precision floating-point number.- Parameters:
name
- the name of the property- Returns:
- the value of the property
- See Also:
getProperty(String)
-
getPropertyAsDouble
public double getPropertyAsDouble(java.lang.String name, double def)Returns the property as a double precision floating-point number. If the property is not set or incorrectly set, the default valuedef
will be returned.- Parameters:
name
- the name of the propertydef
- the default value of the property- Returns:
- the value of the property
- See Also:
getProperty(String)
-
firePropertyChangeEvent
protected void firePropertyChangeEvent(java.beans.PropertyChangeEvent evt)Sends a property change event to all registered property change listeners.- Parameters:
evt
- a property change event to be sent to all registered property change listeners
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)Registers a listener that is interested in the change of this properties.- Parameters:
listener
- a listener that is interested in the change of this properties
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)Unregisters a listener that was interested in the change of this properties.- Parameters:
listener
- a listener that is interested in the change of this properties
-