public class SetProperty<T,K> extends CollectionProperty<T,K>
| Constructor and Description |
|---|
SetProperty(String name)
Constructs a property with null value
|
SetProperty(String name,
Class<T> elementType,
T... values)
Constructs a property with the given name and values by specifying the
type of the elements explicitly.
|
SetProperty(String name,
T... values)
Constructs a property with the given name and value
|
| Modifier and Type | Method and Description |
|---|---|
K |
add(T v)
Adds a property value to the set and fires a change event if it changed the set
|
K |
addAll(Collection<? extends T> v)
Adds a collection of values to the set and fires a change event if it changed the set
|
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 set and fires a change event if the set wasn't empty
|
boolean |
contains(T element)
Returns true if the given element is contained in the set property
|
boolean |
equals(Object obj)
Compares this property to another property
|
int |
hashCode()
Returns the internal hashcode or 0 for null property
|
Iterator<T> |
iterator()
Iterate over the elements of the property
|
K |
remove(int v)
Removes the given item from the set and fires a change event if this item has been successfully removed
|
K |
remove(T v)
Removes the given item from the set and fires a change event if this item has been successfully removed
|
K |
removeAll(Collection<? extends T> v)
Removes from the set all values from the given collection and fires a change event if the set has changed
|
K |
set(Collection<T> t)
Sets the entire content of the property
|
int |
size()
The size of the property set
|
addChangeListener, bindGlobalGetListener, bindGlobalSetListener, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, putClientProperty, removeChangeListener, setLabel, stopListening, toString, validateCollectionTypepublic SetProperty(String name, T... values)
name - the name of the propertyvalues - default values for the propertypublic SetProperty(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 SetProperty(String name)
name - the name of the propertypublic int size()
size in class CollectionProperty<T,K>public K set(Collection<T> t)
set in class CollectionProperty<T,K>t - the collection of elements to setpublic 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 new valuepublic K remove(T v)
remove in class CollectionProperty<T,K>v - the item to removepublic K remove(int v)
remove in class CollectionProperty<T,K>v - the item to removepublic 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 element