public class ObservableList
extends java.lang.Object
implements java.util.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 java.lang.String |
CONTENT_PROPERTY |
static java.lang.String |
SIZE_PROPERTY |
Constructor and Description |
---|
ObservableList() |
ObservableList(Closure test) |
ObservableList(java.util.List delegate) |
ObservableList(java.util.List delegate,
Closure test) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Object element) |
boolean |
add(java.lang.Object o) |
boolean |
addAll(java.util.Collection c) |
boolean |
addAll(int index,
java.util.Collection c) |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
boolean |
equals(java.lang.Object o) |
protected void |
fireElementAddedEvent(int index,
java.lang.Object element) |
protected void |
fireElementClearedEvent(java.util.List values) |
protected void |
fireElementEvent(ObservableList.ElementEvent event) |
protected void |
fireElementRemovedEvent(int index,
java.lang.Object element) |
protected void |
fireElementUpdatedEvent(int index,
java.lang.Object oldValue,
java.lang.Object newValue) |
protected void |
fireMultiElementAddedEvent(int index,
java.util.List values) |
protected void |
fireMultiElementRemovedEvent(java.util.List values) |
protected void |
fireSizeChangedEvent(int oldValue,
int newValue) |
java.lang.Object |
get(int index) |
java.util.List |
getContent() |
protected java.util.List |
getDelegateList() |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners() |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String propertyName) |
int |
getSize() |
protected Closure |
getTest() |
int |
hashCode() |
boolean |
hasListeners(java.lang.String propertyName) |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
java.util.Iterator |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator |
listIterator() |
java.util.ListIterator |
listIterator(int index) |
java.lang.Object |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
boolean |
retainAll(java.util.Collection c) |
java.lang.Object |
set(int index,
java.lang.Object element) |
int |
size() |
java.util.List |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
public static final java.lang.String SIZE_PROPERTY
public static final java.lang.String CONTENT_PROPERTY
public ObservableList()
public ObservableList(java.util.List delegate)
public ObservableList(Closure test)
public ObservableList(java.util.List delegate, Closure test)
public java.util.List getContent()
protected java.util.List getDelegateList()
protected Closure getTest()
protected void fireElementAddedEvent(int index, java.lang.Object element)
protected void fireMultiElementAddedEvent(int index, java.util.List values)
protected void fireElementClearedEvent(java.util.List values)
protected void fireElementRemovedEvent(int index, java.lang.Object element)
protected void fireMultiElementRemovedEvent(java.util.List values)
protected void fireElementUpdatedEvent(int index, java.lang.Object oldValue, java.lang.Object newValue)
protected void fireElementEvent(ObservableList.ElementEvent event)
protected void fireSizeChangedEvent(int oldValue, int newValue)
public void add(int index, java.lang.Object element)
add
in interface java.util.List
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.List
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
contains
in interface java.util.List
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.List
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection
equals
in interface java.util.List
equals
in class java.lang.Object
public java.lang.Object get(int index)
get
in interface java.util.List
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.List
hashCode
in class java.lang.Object
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
public java.lang.Object remove(int index)
remove
in interface java.util.List
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
public int getSize()
public java.util.List subList(int fromIndex, int toIndex)
subList
in interface java.util.List
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public boolean hasListeners(java.lang.String propertyName)