public class ListProperty<T,K> extends CollectionProperty<T,K>
| Constructor and Description |
|---|
ListProperty(String name)
Constructs a property with null value
|
ListProperty(String name,
Class<T> elementType,
T... values)
Constructs a property with the given name and values by specifying the
type of the elements explicitly.
|
ListProperty(String name,
T... values)
Constructs a property with the given name and value
|
| Modifier and Type | Method and Description |
|---|---|
K |
add(int offset,
T v)
Adds a property value and fires a change event
|
K |
add(T v)
Adds a property value to the end of the list and fires a change event
|
K |
addAll(Collection<? extends T> v)
Adds a all properties value to the list and fires a change event
|
List<Object> |
asExplodedList()
Returns a copy of the content as a new list but if the value is a PropertyBusinessObject it will
be converted to a Map
|
List<T> |
asList()
Returns a copy of the content as a new list
|
void |
clear()
Remove all the elements from the list
|
boolean |
contains(T element)
Returns true if the given element is contained in the list property
|
boolean |
equals(Object obj)
Compares this property to another property
|
T |
get(int offset)
Gets the property value
|
int |
hashCode()
Returns the internal hashcode or 0 for null property
|
int |
indexOf(T element)
Returns the index of the given element in the list property
|
Iterator<T> |
iterator()
Iterate over the elements of the property
|
K |
remove(int offset)
Removes the item at the given offset
|
K |
remove(T v)
Removes the item with this value
|
K |
removeAll(Collection<? extends T> v)
Removes from the list all values from the given collection and fires a change event if the list has changed
|
K |
set(Collection<T> t)
Sets the entire content of the property
|
K |
set(int offset,
T v)
Sets the property value and potentially fires a change event
|
K |
setList(Collection<T> t)
Historical alias of set(Collection
|
int |
size()
The size of the property list
|
addChangeListener, bindGlobalGetListener, bindGlobalSetListener, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, putClientProperty, removeChangeListener, setLabel, stopListening, toString, validateCollectionTypepublic ListProperty(String name, T... values)
name - the name of the propertyvalues - default values for the propertypublic ListProperty(String name, Class<T> elementType, T... values)
PropertyBusinessObjects and needs
to get deserialized properly!name - the name of the propertyelementType - subclass of PropertyBusinessObjectvalues - default values for the propertypublic ListProperty(String name)
name - the name of the propertypublic T get(int offset)
offset - the offset within the listpublic int size()
size in class CollectionProperty<T,K>public K set(int offset, T v)
offset - the position for the new valuev - the new valuepublic K set(Collection<T> t)
set in class CollectionProperty<T,K>t - the collection of elements to setpublic K setList(Collection<T> t)
t - the collection of elements to setpublic K add(int offset, T v)
offset - the position for the new valuev - the new valuepublic K add(T v)
add in class CollectionProperty<T,K>v - the new valuepublic K addAll(Collection<? extends T> v)
addAll in class CollectionProperty<T,K>v - the collection of values to addpublic K remove(int offset)
remove in class CollectionProperty<T,K>offset - the offsetpublic K remove(T v)
remove in class CollectionProperty<T,K>v - the value objectpublic K removeAll(Collection<? extends T> v)
removeAll in class CollectionProperty<T,K>the - item to removepublic boolean equals(Object obj)
equals in class PropertyBase<T,K>obj - the other propertypublic int hashCode()
public List<T> asList()
asList in class CollectionProperty<T,K>public List<Object> asExplodedList()
asExplodedList in class CollectionProperty<T,K>public void clear()
clear in class CollectionProperty<T,K>public boolean contains(T element)
contains in class CollectionProperty<T,K>element - the elementpublic int indexOf(T element)
element - the element