java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.db.DBProperties

public class DBProperties extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected Database
     
    protected BTree
     
    protected long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Allocate storage for a new DBProperties record in the specified database
    DBProperties​(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 Type
    Method
    Description
    void
    Deletes all properties, does not delete the record associated with the object itself - that is it can be re-populated.
    void
    Deletes all properties stored in this object and the record associated with this object itself.
    Returns the Set of property names stored in this object
    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
    Deletes a property from this DBProperties object.
    void
    setProperty​(String key, String value)
    Writes the key, value mapping to the properties.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • index

      protected BTree index
    • db

      protected Database db
    • record

      protected long record
  • Constructor Details

    • DBProperties

      public DBProperties(Nd nd) throws IndexException
      Allocate storage for a new DBProperties record in the specified database
      Throws:
      IndexException
    • DBProperties

      public DBProperties(Nd nd, long record) throws IndexException
      Creates an object for accessing an existing DBProperties record at the specified location of the specified database.
      Throws:
      IndexException
  • Method Details

    • getProperty

      public String getProperty(String key) throws IndexException
      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

      public String getProperty(String key, String defaultValue) throws IndexException
      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 null
      defaultValue - 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

      public Set<String> getKeySet() throws IndexException
      Returns the Set of property names stored in this object
      Returns:
      the Set of property names stored in this object
      Throws:
      IndexException
    • setProperty

      public void setProperty(String key, String value) throws IndexException
      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 name
      value - a value to associate with the key. may not be null.
      Throws:
      IndexException
      NullPointerException - if key is null
    • removeProperty

      public boolean removeProperty(String key) throws IndexException
      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

      public void clear() throws IndexException
      Deletes all properties, does not delete the record associated with the object itself - that is it can be re-populated.
      Throws:
      IndexException
    • delete

      public void delete() throws IndexException
      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()