Properties (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
- Direct Known Subclasses:
Provider
-
Field Summary
Fields
A property list that contains default values for any keys not found in this property list.
-
Constructor Summary
Constructors
Creates an empty property list with no default values.
Properties(int initialCapacity) Creates an empty property list with no default values, and with an initial size accommodating the specified number of elements without the need to dynamically resize.
Creates an empty property list with the specified defaults.
-
Method Summary
Searches for the property with the specified key in this property list.
Searches for the property with the specified key in this property list.
voidPrints this property list out to the specified output stream.
voidPrints this property list out to the specified output stream.
voidReads a property list (key and element pairs) from the input byte stream.
voidReads a property list (key and element pairs) from the input character stream in a simple line-oriented format.
voidLoads all of the properties represented by the XML document on the specified input stream into this properties table.
Returns an enumeration of all the keys in this property list, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list.
voidCalls the
Hashtablemethodput.voidWrites this property list (key and element pairs) in this
Propertiestable to the output stream in a format suitable for loading into aPropertiestable using theload(InputStream)method.voidWrites this property list (key and element pairs) in this
Propertiestable to the output character stream in a format suitable for using theload(Reader)method.voidEmits an XML document representing all of the properties contained in this table.
voidEmits an XML document representing all of the properties contained in this table, using the specified encoding.
voidEmits an XML document representing all of the properties contained in this table, using the specified encoding.
Returns an unmodifiable set of keys from this property list where the key and its corresponding value are strings, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list.
Methods declared in class Hashtable
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, merge, put, putAll, rehash, remove, size, toString, valuesvoidClears this hashtable so that it contains no keys.
Creates a shallow copy of this hashtable.
Attempts to compute a mapping for the specified key and its current mapped value, or
nullif there is no current mapping (optional operation).If the specified key is not already associated with a value (or is mapped to
null), attempts to compute its value using the given mapping function and enters it into this map unlessnull(optional operation).If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value (optional operation).
booleanTests if some key maps into the specified value in this hashtable.
booleanTests if the specified object is a key in this hashtable.
booleanReturns true if this hashtable maps one or more keys to this value.
Returns an enumeration of the values in this hashtable.
Returns a
Setview of the mappings contained in this map.booleanCompares the specified Object with this Map for equality, as per the definition in the Map interface.
Returns the value to which the specified key is mapped, or
nullif this map contains no mapping for the key.intReturns the hash code value for this Map as per the definition in the Map interface.
booleanTests if this hashtable maps no keys to values.
Returns an enumeration of the keys in this hashtable.
Returns a
Setview of the keys contained in this map.If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value (optional operation).
Maps the specified
keyto the specifiedvaluein this hashtable.voidCopies all of the mappings from the specified map to this hashtable.
protected voidIncreases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently.
Removes the key (and its corresponding value) from this hashtable.
intReturns the number of keys in this hashtable.
Returns a string representation of this
Hashtableobject in the form of a set of entries, enclosed in braces and separated by the ASCII characters "," (comma and space).Returns a
Collectionview of the values contained in this map.Methods declared in class Object
finalize, getClass, notify, notifyAll, wait, wait, waitprotected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
Methods declared in interface Map
forEach, getOrDefault, putIfAbsent, remove, replace, replace, replaceAlldefault voidPerforms the given action for each entry in this map until all entries have been processed or the action throws an exception.
Returns the value to which the specified key is mapped, or
defaultValueif this map contains no mapping for the key.If the specified key is not already associated with a value (or is mapped to
null) associates it with the given value and returnsnull, else returns the current value (optional operation).default booleanRemoves the entry for the specified key only if it is currently mapped to the specified value (optional operation).
Replaces the entry for the specified key only if it is currently mapped to some value (optional operation).
default booleanReplaces the entry for the specified key only if currently mapped to the specified value (optional operation).
default voidReplaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception (optional operation).
-
Field Details
-
defaults
-
-
Constructor Details
-
Properties
-
Properties
-
Properties
-
-
Method Details
-
setProperty
-
load
-
load
-
save
-
store
-
store
-
loadFromXML
-
storeToXML
-
storeToXML
-
storeToXML
-
getProperty
-
getProperty
-
propertyNames
-
stringPropertyNames
-
list
-
list
-