Класс ReadOnlyMapWrapper<K,V>
- javafx.beans.binding.MapExpression<K,V>
-
- javafx.beans.property.ReadOnlyMapProperty<K,V>
-
- javafx.beans.property.MapProperty<K,V>
-
- javafx.beans.property.MapPropertyBase<K,V>
-
- javafx.beans.property.SimpleMapProperty<K,V>
-
- javafx.beans.property.ReadOnlyMapWrapper<K,V>
Все реализуемые интерфейсы:
Map<K,V>, Observable, Property<ObservableMap<K,V>>, ReadOnlyProperty<ObservableMap<K,V>>, ObservableMapValue<K,V>, ObservableObjectValue<ObservableMap<K,V>>, ObservableValue<ObservableMap<K,V>>, WritableMapValue<K,V>, WritableObjectValue<ObservableMap<K,V>>, WritableValue<ObservableMap<K,V>>, ObservableMap<K,V>
public class ReadOnlyMapWrapper<K,V> extends SimpleMapProperty<K,V>
С тех пор:
JavaFX 2.1
-
Краткое описание свойств
-
Свойства, унаследованные от класса javafx.beans.property.MapPropertyBase
empty, size
-
-
Краткое описание вложенных классов
-
Краткое описание конструкторов
Конструкторы Конструктор и описание ReadOnlyMapWrapper()КонструкторReadOnlyMapWrapperReadOnlyMapWrapper(Object bean, String name)КонструкторReadOnlyMapWrapperReadOnlyMapWrapper(Object bean, String name, ObservableMap<K,V> initialValue)КонструкторReadOnlyMapWrapperReadOnlyMapWrapper(ObservableMap<K,V> initialValue)КонструкторReadOnlyMapWrapper
-
Краткое описание методов
Все методыМетоды экземпляраКонкретные методы Модификатор и тип Метод и описание voidaddListener(ChangeListener<? super ObservableMap<K,V>> listener)Добавляет обработчик событийChangeListener, который будет уведомляться всякий раз, когда меняется значениеObservableValue.voidaddListener(InvalidationListener listener)Добавляет обработчик событийInvalidationListener, который будет уведомляться всякий раз, когдаObservableстановится недействительным.voidaddListener(MapChangeListener<? super K,? super V> listener)Добавляет слушателя в эту карту, которая может наблюдаться.protected voidfireValueChangedEvent()Отправляет уведомления всем подключённымInvalidationListeners,ChangeListenersиMapChangeListener.protected voidfireValueChangedEvent(MapChangeListener.Change<? extends K,? extends V> change)Отправляет уведомления всем подключённымInvalidationListeners,ChangeListenersиMapChangeListener.ReadOnlyMapProperty<K,V>getReadOnlyProperty()Возвращает свойство только для чтения, синхронизированное с этойReadOnlyMapWrapper.voidremoveListener(ChangeListener<? super ObservableMap<K,V>> listener)Удаляет указанного слушателя из списка слушателей, которые уведомляются при изменении значенияObservableValue.voidremoveListener(InvalidationListener listener)Удаляет указанного слушателя из списка слушателей, которые уведомляются при изменении значенияObservable.voidremoveListener(MapChangeListener<? super K,? super V> listener)Пытается удалить слушателя из этого наблюдаемого списка.-
Методы, унаследованные от класса javafx.beans.property.SimpleMapProperty
getBean, getName
-
Методы, унаследованные от класса javafx.beans.property.MapPropertyBase
bind, emptyProperty, get, invalidated, isBound, set, sizeProperty, toString, unbind
-
Методы, унаследованные от класса javafx.beans.property.MapProperty
bindBidirectional, setValue, unbindBidirectional
-
Методы, унаследованные от класса javafx.beans.property.ReadOnlyMapProperty
bindContent, bindContentBidirectional, equals, hashCode, unbindContent, unbindContentBidirectional
-
Методы, унаследованные от класса javafx.beans.binding.MapExpression
asString, clear, containsKey, containsValue, entrySet, get, getSize, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, keySet, mapExpression, put, putAll, remove, size, valueAt, valueAt, values
-
Методы, унаследованные от класса java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Методы, унаследованные от интерфейса javafx.beans.value.ObservableValue
getValue
-
Методы, унаследованные от интерфейса javafx.beans.value.WritableValue
getValue
-
Методы, унаследованные от интерфейса java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
Детали конструктора
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper()
The constructor ofReadOnlyMapWrapper
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper(ObservableMap<K,V> initialValue)
The constructor ofReadOnlyMapWrapperПараметры:
initialValue- the initial value of the wrapped value
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper(Object bean, String name)The constructor ofReadOnlyMapWrapperПараметры:
bean- the bean of thisReadOnlyMapWrapper
-
ReadOnlyMapWrapper
public ReadOnlyMapWrapper(Object bean, String name, ObservableMap<K,V> initialValue)The constructor ofReadOnlyMapWrapperПараметры:
bean- the bean of thisReadOnlyMapWrapper
-
-
Детали методов
-
getReadOnlyProperty
public ReadOnlyMapProperty<K,V> getReadOnlyProperty()
Returns the readonly property, that is synchronized with thisReadOnlyMapWrapper.Возвращает:
the readonly property
-
addListener
public void addListener(InvalidationListener listener)
Adds anInvalidationListenerwhich will be notified whenever theObservablebecomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.Note that the same actual
InvalidationListenerinstance may be safely registered for differentObservables.The
Observablestores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by callingremoveListenerafter use or to use an instance ofWeakInvalidationListeneravoid this situation.Определено в:
addListenerin interfaceObservableПереопределено в:
addListenerin classMapPropertyBase<K,V>Параметры:
listener- The listener to register
-
removeListener
public void removeListener(InvalidationListener listener)
Removes the given listener from the list of listeners, that are notified whenever the value of theObservablebecomes invalid.If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
Определено в:
removeListenerin interfaceObservableПереопределено в:
removeListenerin classMapPropertyBase<K,V>Параметры:
listener- The listener to removeСм. также:
-
addListener
public void addListener(ChangeListener<? super ObservableMap<K,V>> listener)
Adds aChangeListenerwhich will be notified whenever the value of theObservableValuechanges. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.Note that the same actual
ChangeListenerinstance may be safely registered for differentObservableValues.The
ObservableValuestores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by callingremoveListenerafter use or to use an instance ofWeakChangeListeneravoid this situation.Определено в:
addListenerin interfaceObservableValue<ObservableMap<K,V>>Переопределено в:
addListenerin classMapPropertyBase<K,V>Параметры:
listener- The listener to register
-
removeListener
public void removeListener(ChangeListener<? super ObservableMap<K,V>> listener)
Removes the given listener from the list of listeners, that are notified whenever the value of theObservableValuechanges.If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
Определено в:
removeListenerin interfaceObservableValue<ObservableMap<K,V>>Переопределено в:
removeListenerin classMapPropertyBase<K,V>Параметры:
listener- The listener to removeСм. также:
-
addListener
public void addListener(MapChangeListener<? super K,? super V> listener)
Add a listener to this observable map.Определено в:
addListenerin interfaceObservableMap<K,V>Переопределено в:
addListenerin classMapPropertyBase<K,V>Параметры:
listener- the listener for listening to the list changes
-
removeListener
public void removeListener(MapChangeListener<? super K,? super V> listener)
Tries to removed a listener from this observable list. If the listener is not attached to this list, nothing happens.Определено в:
removeListenerin interfaceObservableMap<K,V>Переопределено в:
removeListenerin classMapPropertyBase<K,V>Параметры:
listener- a listener to remove
-
fireValueChangedEvent
protected void fireValueChangedEvent()
Sends notifications to all attachedInvalidationListeners,ChangeListeners, andMapChangeListener. This method is called when the value is changed, either manually by callingMapPropertyBase.set(javafx.collections.ObservableMap)or in case of a bound property, if the binding becomes invalid.Переопределено в:
fireValueChangedEventin classMapPropertyBase<K,V>
-
fireValueChangedEvent
protected void fireValueChangedEvent(MapChangeListener.Change<? extends K,? extends V> change)
Sends notifications to all attachedInvalidationListeners,ChangeListeners, andMapChangeListener. This method is called when the content of the list changes.Переопределено в:
fireValueChangedEventin classMapPropertyBase<K,V>Параметры:
change- the change that needs to be propagated
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.