Class PropertyMap


  • public class PropertyMap
    extends java.lang.Object
    Container for a collection of Property Objects

    This container is used to bind various user information to for example
    Frame.

    Example: Getting a string property with ID "Camera" from a frame

    const std::string* ptr = frame.getPropertyMap().getPtr<std::string>("Camera"); if (ptr) { std::cout << "Property 'Camera' has value " << *ptr << "\n"; }
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(PropertyBasePtr property)
      Adds a property to the map

      This will fire a PropertyChangedEvent.

      void addChangedListener​(SWIGTYPE_p_std__functionT_void_frw__core__PropertyMap_p_rw__core__PropertyBase_pF_t callback)
      Add listener to be call, when the property changes
      PropertyMap assign​(PropertyMap other)
      Assignment operator.
      void clear()
      Clear the content of the property map
      void clearChangedListeners()
      Clears the list of changed listeners
      void delete()  
      boolean empty()
      True iff the property map contains no properties.
      boolean erase​(java.lang.String identifier)
      Remove a property

      PropertyBasePtr findPropertyBase​(java.lang.String identifier)
      Find the property base for an identifier.

      The find methods returns pointer to PropertyBase object or NULL if a
      property base with that identifier does not exist.

      SWIGTYPE_p_bool getBool​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      SWIGTYPE_p_bool getBool​(java.lang.String identifier, boolean defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      static long getCPtr​(PropertyMap obj)  
      SWIGTYPE_p_double getDouble​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      SWIGTYPE_p_double getDouble​(java.lang.String identifier, double defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      SWIGTYPE_p_float getFloat​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      SWIGTYPE_p_float getFloat​(java.lang.String identifier, float defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      SWIGTYPE_p_int getInt​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      SWIGTYPE_p_int getInt​(java.lang.String identifier, int defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      java.lang.String getName()
      get the name of this propertymap
      java.lang.String getString​(java.lang.String id)  
      vector_b getVectorBool​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      vector_b getVectorBool​(java.lang.String identifier, vector_b defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      vector_d getVectorDouble​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      vector_d getVectorDouble​(java.lang.String identifier, vector_d defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      vector_f getVectorFloat​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      vector_f getVectorFloat​(java.lang.String identifier, vector_f defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      vector_i getVectorInt​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      vector_i getVectorInt​(java.lang.String identifier, vector_i defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      vector_s getVectorString​(java.lang.String identifier)
      Get the value of a property

      If a property of the given identifier and type cannot be found, the
      method throws an exception

      vector_s getVectorString​(java.lang.String identifier, vector_s defval)
      Get the value of a property if it exists.

      If a property of the given identifier and type cannot be found, the
      method returns the default value defval.

      example
      int iterations = map.get<int>("Iterations", 20);

      This will fire a PropertyChangedEvent if a new property is added.
      Notice that a new property is inserted in the map with the default
      value if it does not already exist.

      boolean has​(java.lang.String identifier)
      True if a specific property exists

      void notifyListeners()
      Notifies listeners about a change in the Property
      void notifyListeners​(PropertyBase base)
      Notifies listeners about a change in the Property
      void propertyChangedListener​(PropertyBase base)
      used for listening for property changes in the map
      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_bool_t_t setBool​(java.lang.String identifier, boolean value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_double_t_t setDouble​(java.lang.String identifier, double value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_float_t_t setFloat​(java.lang.String identifier, float value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_int_t_t setInt​(java.lang.String identifier, int value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__string_t_t setString​(java.lang.String identifier, java.lang.String value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_bool_t_t_t setVectorBool​(java.lang.String identifier, vector_b value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_double_t_t_t setVectorDouble​(java.lang.String identifier, vector_d value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_float_t_t_t setVectorFloat​(java.lang.String identifier, vector_f value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_int_t_t_t setVectorInt​(java.lang.String identifier, vector_i value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_std__string_t_t_t setVectorString​(java.lang.String identifier, vector_s value)
      Set the value of a property

      If a property with the given identifier cannot be found, a new
      property with no description is created and inserted.

      This will fire a PropertyChangedEvent.

      long size()
      The number of properties
      void swap​(PropertyMap other)
      swap operator.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyMap

        public PropertyMap​(long cPtr,
                           boolean cMemoryOwn)
      • PropertyMap

        public PropertyMap()
        Constructor
      • PropertyMap

        public PropertyMap​(java.lang.String name)
        constructor
        Parameters:
        name - [in] name of this propertymap
      • PropertyMap

        public PropertyMap​(PropertyMap other)
        Copy constructor.
    • Method Detail

      • getCPtr

        public static long getCPtr​(PropertyMap obj)
      • delete

        public void delete()
      • swap

        public void swap​(PropertyMap other)
        swap operator.
      • clear

        public void clear()
        Clear the content of the property map
      • getName

        public java.lang.String getName()
        get the name of this propertymap
        Returns:
        name of this propertymap
      • add

        public boolean add​(PropertyBasePtr property)
        Adds a property to the map

        This will fire a PropertyChangedEvent.

        Parameters:
        property - [in] Property to add

        Returns:
        True if added, false if property already exists.
      • has

        public boolean has​(java.lang.String identifier)
        True if a specific property exists

        Parameters:
        identifier - [in] The identifier of the property
        Returns:
        true if the property exists
      • size

        public long size()
        The number of properties
      • empty

        public boolean empty()
        True iff the property map contains no properties.
      • erase

        public boolean erase​(java.lang.String identifier)
        Remove a property

        Returns:
        true if the property was successfully removed.
      • findPropertyBase

        public PropertyBasePtr findPropertyBase​(java.lang.String identifier)
        Find the property base for an identifier.

        The find methods returns pointer to PropertyBase object or NULL if a
        property base with that identifier does not exist.

        Parameters:
        identifier - [in] identifier for the property base to find.
      • clearChangedListeners

        public void clearChangedListeners()
        Clears the list of changed listeners
      • notifyListeners

        public void notifyListeners​(PropertyBase base)
        Notifies listeners about a change in the Property
      • notifyListeners

        public void notifyListeners()
        Notifies listeners about a change in the Property
      • propertyChangedListener

        public void propertyChangedListener​(PropertyBase base)
        used for listening for property changes in the map
        Parameters:
        base -
      • getBool

        public SWIGTYPE_p_bool getBool​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getBool

        public SWIGTYPE_p_bool getBool​(java.lang.String identifier,
                                       boolean defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getInt

        public SWIGTYPE_p_int getInt​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getInt

        public SWIGTYPE_p_int getInt​(java.lang.String identifier,
                                     int defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getFloat

        public SWIGTYPE_p_float getFloat​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getFloat

        public SWIGTYPE_p_float getFloat​(java.lang.String identifier,
                                         float defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getDouble

        public SWIGTYPE_p_double getDouble​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getDouble

        public SWIGTYPE_p_double getDouble​(java.lang.String identifier,
                                           double defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getString

        public java.lang.String getString​(java.lang.String id)
      • getVectorString

        public vector_s getVectorString​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getVectorString

        public vector_s getVectorString​(java.lang.String identifier,
                                        vector_s defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getVectorBool

        public vector_b getVectorBool​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getVectorBool

        public vector_b getVectorBool​(java.lang.String identifier,
                                      vector_b defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getVectorInt

        public vector_i getVectorInt​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getVectorInt

        public vector_i getVectorInt​(java.lang.String identifier,
                                     vector_i defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getVectorFloat

        public vector_f getVectorFloat​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getVectorFloat

        public vector_f getVectorFloat​(java.lang.String identifier,
                                       vector_f defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • getVectorDouble

        public vector_d getVectorDouble​(java.lang.String identifier)
        Get the value of a property

        If a property of the given identifier and type cannot be found, the
        method throws an exception

        Parameters:
        identifier - [in] the identifier of the property

        Returns:
        the value of the property
      • getVectorDouble

        public vector_d getVectorDouble​(java.lang.String identifier,
                                        vector_d defval)
        Get the value of a property if it exists.

        If a property of the given identifier and type cannot be found, the
        method returns the default value defval.

        example
        int iterations = map.get<int>("Iterations", 20);

        This will fire a PropertyChangedEvent if a new property is added.
        Notice that a new property is inserted in the map with the default
        value if it does not already exist.

        Parameters:
        identifier - [in] the identifier of the property
        defval - [in] the value that will be returned if property with
        identifier is not found.
        Returns:
        the value of the property if it exists, else defval is returned
      • setBool

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_bool_t_t setBool​(java.lang.String identifier,
                                                                              boolean value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setInt

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_int_t_t setInt​(java.lang.String identifier,
                                                                            int value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setFloat

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_float_t_t setFloat​(java.lang.String identifier,
                                                                                float value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setDouble

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_double_t_t setDouble​(java.lang.String identifier,
                                                                                  double value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setString

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__string_t_t setString​(java.lang.String identifier,
                                                                                       java.lang.String value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setVectorString

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_std__string_t_t_t setVectorString​(java.lang.String identifier,
                                                                                                            vector_s value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setVectorBool

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_bool_t_t_t setVectorBool​(java.lang.String identifier,
                                                                                                   vector_b value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setVectorInt

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_int_t_t_t setVectorInt​(java.lang.String identifier,
                                                                                                 vector_i value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setVectorFloat

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_float_t_t_t setVectorFloat​(java.lang.String identifier,
                                                                                                     vector_f value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value
      • setVectorDouble

        public SWIGTYPE_p_rw__core__PtrT_rw__core__PropertyT_std__vectorT_double_t_t_t setVectorDouble​(java.lang.String identifier,
                                                                                                       vector_d value)
        Set the value of a property

        If a property with the given identifier cannot be found, a new
        property with no description is created and inserted.

        This will fire a PropertyChangedEvent.

        Parameters:
        identifier - [in] the property identifier
        value - [in] the new value