Class DBProperties
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.db.DBProperties
DBProperties is a bare-bones implementation of a String->String mapping. It is neither
a Map or a Properties subclass, because of their more general applications.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDBProperties(Nd nd)
Allocate storage for a new DBProperties record in the specified databaseDBProperties(Nd nd, long record)
Creates an object for accessing an existing DBProperties record at the specified location of the specified database. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Deletes all properties, does not delete the record associated with the object itself - that is it can be re-populated.void
delete()
Deletes all properties stored in this object and the record associated with this object itself.Returns the Set of property names stored in this objectgetProperty(String key)
Reads the named property from this properties storage.getProperty(String key, String defaultValue)
Reads the named property from this properties storage, returning the default value if there is no such property.long
boolean
removeProperty(String key)
Deletes a property from this DBProperties object.void
setProperty(String key, String value)
Writes the key, value mapping to the properties.
-
Field Details
-
index
-
db
-
record
protected long record
-
-
Constructor Details
-
DBProperties
Allocate storage for a new DBProperties record in the specified database- Throws:
IndexException
-
DBProperties
Creates an object for accessing an existing DBProperties record at the specified location of the specified database.- Throws:
IndexException
-
-
Method Details
-
getProperty
Reads the named property from this properties storage.- Parameters:
key
- a case-sensitive identifier for a property, or null- Returns:
- the value associated with the key, or null if either no such property is set, or the specified key was null
- Throws:
IndexException
-
getProperty
Reads the named property from this properties storage, returning the default value if there is no such property.- Parameters:
key
- a case-sensitive identifier for a property, or nulldefaultValue
- a value to return in case the specified key was null- Returns:
- the value associated with the key, or the specified default value if either no such property is set, or the specified key was null
- Throws:
IndexException
-
getKeySet
Returns the Set of property names stored in this object- Returns:
- the Set of property names stored in this object
- Throws:
IndexException
-
setProperty
Writes the key, value mapping to the properties. If a mapping for the same key already exists, it is overwritten.- Parameters:
key
- a non-null property namevalue
- a value to associate with the key. may not be null.- Throws:
IndexException
NullPointerException
- if key is null
-
removeProperty
Deletes a property from this DBProperties object.- Parameters:
key
-- Returns:
- whether a property with matching key existed and was removed, or false if the key was null
- Throws:
IndexException
-
clear
Deletes all properties, does not delete the record associated with the object itself - that is it can be re-populated.- Throws:
IndexException
-
delete
Deletes all properties stored in this object and the record associated with this object itself.
The behaviour of objects of this class after calling this method is undefined- Throws:
IndexException
-
getRecord
public long getRecord()
-