org.eclipse.emf.ecp.core.util
Interface ECPProperties

All Known Implementing Classes:
Properties

public interface ECPProperties

ECPProperties are used to store key - value - pairs. It publishes observable events on the ECPObserverBus. Related Observer types: ECPPropertiesObserver. Use ECPUtil.getECPObserverBus() to retrieve the ObserverBus and ECPObserverBus#register(ECPObserver) to register an Observer.

Author:
Eike Stepper, Eugen Neufeld

Method Summary
 void addObserver(ECPPropertiesObserver changeObserver)
          Adds an ECPPropertiesObserver which will be notified if a property changes.
 void addProperty(String key, String value)
          Adds a key-value-pair.
 ECPProperties copy()
          Creates a copy of the current set of properties.
 Set<String> getKeys()
          All stored keys.
 Collection<Map.Entry<String,String>> getProperties()
          All Properties.
 String getValue(String key)
          Get the value of a property identified by this key.
 boolean hasProperties()
          Whether any properties are stored.
 void removeObserver(ECPPropertiesObserver changeObserver)
          Removes an ECPPropertiesObserver from the collection of observer which will be notified if a property changes.
 void removeProperty(String key)
          Removes a property.
 

Method Detail

addProperty

void addProperty(String key,
                 String value)
Adds a key-value-pair.

Parameters:
key - the key of the property
value - the value of the property

removeProperty

void removeProperty(String key)
Removes a property.

Parameters:
key - of the property to remove

getValue

String getValue(String key)
Get the value of a property identified by this key.

Parameters:
key - the key of the property to find
Returns:
the value of the property identified by the key or null

getKeys

Set<String> getKeys()
All stored keys.

Returns:
an array of all keys

getProperties

Collection<Map.Entry<String,String>> getProperties()
All Properties.

Returns:
an array of Key-Value-Pairs

hasProperties

boolean hasProperties()
Whether any properties are stored.

Returns:
true if at least 1 property was added, false otherwise

copy

ECPProperties copy()
Creates a copy of the current set of properties.

Returns:
the copy of the current properties

addObserver

void addObserver(ECPPropertiesObserver changeObserver)
Adds an ECPPropertiesObserver which will be notified if a property changes.

Parameters:
changeObserver - the observer to add

removeObserver

void removeObserver(ECPPropertiesObserver changeObserver)
Removes an ECPPropertiesObserver from the collection of observer which will be notified if a property changes.

Parameters:
changeObserver - the observer to remove


Copyright © 2015. All Rights Reserved.