Module javafx.base

Class MapExpression<K,​V>

    • Constructor Detail

      • MapExpression

        public MapExpression()
    • Method Detail

      • mapExpression

        public static <K,​V> MapExpression<K,​V> mapExpression​(ObservableMapValue<K,​V> value)
        Returns a MapExpression that wraps a ObservableMapValue. If the ObservableMapValue is already a MapExpression, it will be returned. Otherwise a new MapBinding is created that is bound to the ObservableMapValue.
        Type Parameters:
        K - the type of the key elements
        V - the type of the value elements
        Parameters:
        value - The source ObservableMapValue
        Returns:
        A MapExpression that wraps the ObservableMapValue if necessary
        Throws:
        NullPointerException - if value is null
      • getSize

        public int getSize()
        The size of the map
        Returns:
        the size
      • valueAt

        public ObjectBinding<V> valueAt​(K key)
        Creates a new ObjectBinding that contains the mapping of the specified key.
        Parameters:
        key - the key of the mapping
        Returns:
        the ObjectBinding
      • isNull

        public BooleanBinding isNull()
        Creates a new BooleanBinding that holds true if the wrapped map is null.
        Returns:
        the new BooleanBinding
      • isNotNull

        public BooleanBinding isNotNull()
        Creates a new BooleanBinding that holds true if the wrapped map is not null.
        Returns:
        the new BooleanBinding
      • asString

        public StringBinding asString()
        Creates a StringBinding that holds the value of the MapExpression turned into a String. If the value of this MapExpression changes, the value of the StringBinding will be updated automatically.
        Returns:
        the new StringBinding
      • size

        public int size()
        Specified by:
        size in interface Map<K,​V>
      • isEmpty

        public boolean isEmpty()
        Gets the value of the property empty.
        Specified by:
        isEmpty in interface Map<K,​V>
        Property description:
        A boolean property that is true, if the map is empty.
      • containsKey

        public boolean containsKey​(Object obj)
        Specified by:
        containsKey in interface Map<K,​V>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface Map<K,​V>
      • remove

        public V remove​(Object obj)
        Specified by:
        remove in interface Map<K,​V>
      • putAll

        public void putAll​(Map<? extends K,​? extends V> elements)
        Specified by:
        putAll in interface Map<K,​V>
      • clear

        public void clear()
        Specified by:
        clear in interface Map<K,​V>
      • keySet

        public Set<K> keySet()
        Specified by:
        keySet in interface Map<K,​V>
      • get

        public V get​(Object key)
        Specified by:
        get in interface Map<K,​V>