Class CollectionProperty<T,K>
java.lang.Object
com.codename1.properties.PropertyBase<T,K>
com.codename1.properties.CollectionProperty<T,K>
- All Implemented Interfaces:
Iterable<T>
- Direct Known Subclasses:
ListProperty, SetProperty
Base class for a property as a collection which can contain multiple elements within
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionProperty(String name) CollectionProperty(String name, Class genericType) -
Method Summary
Modifier and TypeMethodDescriptionabstract KAdds a property value to the collection and fires a change event if collection has changedabstract KaddAll(Collection<? extends T> v) Adds a collection of values to the collection and fires a change event if the collection has changedReturns a copy of the content as a new list but if the value is a PropertyBusinessObject it will be converted to a MapasList()Returns a copy of the content as a new listabstract voidclear()Remove all the elements from the collection and fires a change eventabstract booleanReturns true if the given element is contained in the collection propertyiterator()Iterate over the elements of the propertyabstract Kremove(int offset) Removes the given itemabstract KRemoves the given itemabstract KremoveAll(Collection<? extends T> v) Removes from this collection all of its elements that are contained in the specified collection and fires a change event if the collection has changedabstract Kset(Collection<T> t) Sets the entire content of the propertyabstract intsize()The size of the property collectionMethods inherited from class PropertyBase
addChangeListener, bindGlobalGetListener, bindGlobalSetListener, equals, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, hashCode, putClientProperty, removeChangeListener, setLabel, stopListening, toString, validateCollectionTypeMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
CollectionProperty
-
CollectionProperty
-
-
Method Details
-
size
public abstract int size()The size of the property collection
Returns
the number of elements
-
set
Sets the entire content of the property
Parameters
t: the collection of elements to set
Returns
the parent object for chaining
-
add
-
addAll
Adds a collection of values to the collection and fires a change event if the collection has changed
Parameters
v: the collection of values to add
-
remove
-
remove
Removes the given item
Parameters
offset: the index
-
removeAll
Removes from this collection all of its elements that are contained in the specified collection and fires a change event if the collection has changed
Parameters
v: the collection of values to remove
-
iterator
-
asList
-
asExplodedList
-
clear
public abstract void clear()Remove all the elements from the collection and fires a change event -
contains
Returns true if the given element is contained in the collection property
Parameters
element: the element
Returns
true if the given element is contained in the collection property
-