public class ObservableMap extends Object implements Map
// skip all properties whose value is a closure def map = new ObservableMap( {!(it instanceof Closure)} ) // skip all properties whose name matches a regex def map = new ObservableMap( { name, value -> !(name =~ /[A-Z+]/) } )The current implementation will trigger specialized events in the following scenarios, you need not register a different listener as those events extend from PropertyChangeEvent
Bound properties
Modifier and Type | Class and Description |
---|---|
static class |
ObservableMap.ChangeType |
static class |
ObservableMap.MultiPropertyEvent |
static class |
ObservableMap.PropertyAddedEvent |
static class |
ObservableMap.PropertyClearedEvent |
static class |
ObservableMap.PropertyEvent |
static class |
ObservableMap.PropertyRemovedEvent |
static class |
ObservableMap.PropertyUpdatedEvent |
Modifier and Type | Field and Description |
---|---|
static String |
CLEARED_PROPERTY |
static String |
CONTENT_PROPERTY |
static String |
SIZE_PROPERTY |
Constructor and Description |
---|
ObservableMap() |
ObservableMap(Closure test) |
ObservableMap(Map delegate) |
ObservableMap(Map delegate,
Closure test) |
public static final String SIZE_PROPERTY
public static final String CONTENT_PROPERTY
public static final String CLEARED_PROPERTY
public ObservableMap()
public ObservableMap(Closure test)
public ObservableMap(Map delegate)
protected Map getMapDelegate()
protected Closure getTest()
public Map getContent()
protected void firePropertyClearedEvent(Map values)
protected void firePropertyUpdatedEvent(Object key, Object oldValue, Object newValue)
protected void fireMultiPropertyEvent(List<ObservableMap.PropertyEvent> events)
protected void fireMultiPropertyEvent(ObservableMap.PropertyEvent[] events)
protected void firePropertyEvent(ObservableMap.PropertyEvent event)
protected void fireSizeChangedEvent(int oldValue, int newValue)
public boolean containsKey(Object key)
containsKey
in interface Map
public boolean containsValue(Object value)
containsValue
in interface Map
public boolean equals(Object o)
public int hashCode()
public int getSize()
public Collection values()
public void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
public PropertyChangeListener[] getPropertyChangeListeners()
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
public boolean hasListeners(String propertyName)