Class ALcyPropertiesWrapper

java.lang.Object
com.luciad.lucy.util.properties.ALcyProperties
com.luciad.lucy.util.properties.ALcyPropertiesWrapper
All Implemented Interfaces:
ILcdPropertyChangeSource

public abstract class ALcyPropertiesWrapper extends ALcyProperties

Convenience class to wrap an ALcyProperties in that one only has to overwrite those methods that are required. This is also known as the decorator design pattern.

Note that, generally speaking, an abstract class can't be wrapped because methods might be added to the abstract class in a newer version of the API. The advantage of extending from this ALcyPropertiesWrapper is that if methods are ever added to ALcyProperties, they will also be added here.

  • Constructor Details

    • ALcyPropertiesWrapper

      protected ALcyPropertiesWrapper(ALcyProperties aProperties)

      Constructs a new ALcyPropertiesWrapper that decorates the specified ALcyProperties.

      Note that this wrapper does not propagate property change events. It is up to the subclasses, who know how the keys and/or values are modified, to make sure that the correct property change events are fired when the wrapped ALcyProperties instance changes.

      Parameters:
      aProperties - The ALcyProperties to decorate. Must not be null.
  • Method Details

    • getProperties

      public ALcyProperties getProperties()

      Returns the original ALcyProperties that is wrapped by this wrapper.

      Returns:
      The original ALcyProperties. Never null.
    • getImpl

      protected Object getImpl(String aKey)
      Description copied from class: ALcyProperties
      Implementation version of the get method, which retrieves the value from the underlying store.
      Specified by:
      getImpl in class ALcyProperties
      Parameters:
      aKey - The key, guaranteed to be not null.
      Returns:
      The value associated with the key, or null if no value is associated.
    • putImpl

      protected void putImpl(String aKey, Object aValue)
      Description copied from class: ALcyProperties
      Implementation version of the put method, which puts the value in the underlying store.
      Specified by:
      putImpl in class ALcyProperties
      Parameters:
      aKey - The key, guaranteed to be not null.
      aValue - The value to associate to the key, guaranteed to be not null.
    • remove

      public void remove(String aKey)
      Description copied from class: ALcyProperties
      Removes the key (and its corresponding value) from this key-value pair list. This method does nothing if the key is unknown.
      Specified by:
      remove in class ALcyProperties
      Parameters:
      aKey - the key to be removed
    • putAll

      public void putAll(ALcyProperties aFromNode)
      Description copied from class: ALcyProperties
      Copies all key value pairs from the given properties into this one.
      Overrides:
      putAll in class ALcyProperties
      Parameters:
      aFromNode - The properties to copy from.
    • size

      public int size()
      Description copied from class: ALcyProperties
      Returns the number of key-value pairs.
      Specified by:
      size in class ALcyProperties
      Returns:
      the number of key-value pairs.
    • containsKey

      public boolean containsKey(String aKey)
      Description copied from class: ALcyProperties
      Returns true if the key-value pair with the specified key exists.
      Specified by:
      containsKey in class ALcyProperties
      Parameters:
      aKey - key to look for
      Returns:
      true if the key-value pair with the specified key exists.
    • keys

      public Iterator<String> keys()
      Description copied from class: ALcyProperties
      Returns the keys of this TLcyProperties.
      Specified by:
      keys in class ALcyProperties
      Returns:
      the keys of this TLcyProperties.
    • clear

      public void clear()
      Description copied from class: ALcyProperties
      Clears this key-value pair list so that it contains no keys. Calling this method could result in a null-null-null property change event indicating all properties have changed, or in a separate event for all removed properties (implementation specific).
      Specified by:
      clear in class ALcyProperties