public class ObservableList extends Object implements List
// skip all properties whose value is a closure def map = new ObservableList( {!(it instanceof Closure)} ) // skip all properties whose name matches a regex def map = new ObservableList( { 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 |
ObservableList.ChangeType |
static class |
ObservableList.ElementAddedEvent |
static class |
ObservableList.ElementClearedEvent |
static class |
ObservableList.ElementEvent |
static class |
ObservableList.ElementRemovedEvent |
static class |
ObservableList.ElementUpdatedEvent |
static class |
ObservableList.MultiElementAddedEvent |
static class |
ObservableList.MultiElementRemovedEvent |
protected class |
ObservableList.ObservableIterator |
protected class |
ObservableList.ObservableListIterator |
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_PROPERTY |
static String |
SIZE_PROPERTY |
Constructor and Description |
---|
ObservableList() |
ObservableList(Closure test) |
ObservableList(List delegate) |
ObservableList(List delegate,
Closure test) |
public static final String SIZE_PROPERTY
public static final String CONTENT_PROPERTY
public ObservableList()
public ObservableList(List delegate)
public ObservableList(Closure test)
public List getContent()
protected List getDelegateList()
protected Closure getTest()
protected void fireElementAddedEvent(int index, Object element)
protected void fireMultiElementAddedEvent(int index, List values)
protected void fireElementClearedEvent(List values)
protected void fireElementRemovedEvent(int index, Object element)
protected void fireMultiElementRemovedEvent(List values)
protected void fireElementUpdatedEvent(int index, Object oldValue, Object newValue)
protected void fireElementEvent(ObservableList.ElementEvent event)
protected void fireSizeChangedEvent(int oldValue, int newValue)
public boolean add(Object o)
add
in interface Collection
add
in interface List
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
public boolean addAll(int index, Collection c)
public void clear()
clear
in interface Collection
clear
in interface List
public boolean contains(Object o)
contains
in interface Collection
contains
in interface List
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
public boolean equals(Object o)
public int hashCode()
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
public Iterator iterator()
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface List
public int size()
size
in interface Collection
size
in interface List
public int getSize()
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface List
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)