Class MapProperty<T,J,K>
java.lang.Object
com.codename1.properties.PropertyBase<Map.Entry<T,J>, K>
com.codename1.properties.MapProperty<T,J,K>
public class MapProperty<T,J,K>
extends PropertyBase<Map.Entry<T,J>, K>
implements Iterable<Map.Entry<T,J>>
Base class for a property as a Map which can contain multiple elements within it
-
Constructor Summary
ConstructorsConstructorDescriptionMapProperty(String name) Constructs a property with the given nameMapProperty(String name, Class genericTypeKey, Class genericTypeValue) Constructs a property with the given name -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of the content as a new map but if the value is a PropertyBusinessObject it will be converted to a MapasMap()Returns a copy of the content as a new mapvoidclear()Remove all the elements from the mapbooleanCompares this property to another propertyGets the property valueReturns the class for the key element if it's defined or null if it isn'tReturns the class for the value element if it's defined or null if it isn'tinthashCode()Returns the internal hashcode or 0 for null propertyiterator()Iterate over the elements of the propertykeySet()Returns the set of keys in the map propertySame asjava.lang.Object)here for coding convention convenience with map codeRemoves the item matching the given keySets the property value and potentially fires a change eventSets the entire content of the propertyintsize()The size of the property listvalueSet()Returns the set of values in the map propertyMethods inherited from class PropertyBase
addChangeListener, bindGlobalGetListener, bindGlobalSetListener, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, putClientProperty, removeChangeListener, setLabel, stopListening, toString, validateCollectionTypeModifier and TypeMethodDescriptionvoidFires a notification that a property value changed to the given listenerstatic voidbindGlobalGetListener(PropertyChangeListener listener) Binds an event callback for get calls and property readsstatic voidbindGlobalSetListener(PropertyChangeListener listener) Binds an event callback for set calls and property mutationprotected voidDelivers the property change event to listeners if applicablegetClientProperty(String key) Returns the client property set to this property nameReturns the generic type of this property if it is known or nullgetLabel()The label of the property defaults to its name but can be changed to anythinggetName()The property name is immutable and can't be changed after creation it should match the parent field name by conventionvoidputClientProperty(String key, Object o) Places a property that will apply statically to all instances of this propertyvoidRemoves the property change listener from the list of listenersvoidThe label of the property defaults to its name but can be changed to anything, it can be used when binding a property to UI elementsvoidThis method will work when invoked from a propertyChanged callback and should be similar toremovePropertyChangeListener(this).toString()Default toString that provides easier debug informationprotected final voidvalidateCollectionType(Class elementType) Validates that the collection type is valid and throws an exception otherwiseMethods inherited from class Object
clone, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()final ClassgetClass()Returns the runtime class of an object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
MapProperty
Constructs a property with the given name
Parameters
name: the name of the property
-
MapProperty
-
-
Method Details
-
getKeyType
Returns the class for the key element if it's defined or null if it isn't
Returns
the class matching the map key
-
getValueType
Returns the class for the value element if it's defined or null if it isn't
Returns
the class matching the map value
-
get
-
size
public int size()The size of the property list
Returns
the number of elements
-
set
-
put
-
remove
-
equals
-
hashCode
-
iterator
-
keySet
-
valueSet
Returns the set of values in the map property
Returns
the values
-
asMap
-
asExplodedMap
-
setMap
-
clear
public void clear()Remove all the elements from the map
-