Class AssociativeArray

    • Constructor Detail

      • AssociativeArray

        public AssociativeArray()
        Default constructor which initializes the internal data with a LinkedHashMap.
      • AssociativeArray

        public AssociativeArray​(Map<Object,​Object> internalData)
        Constructor that initializes the internal data with the provided map.
        Parameters:
        internalData -
    • Method Detail

      • copy2Unmodifiable

        public static AssociativeArray copy2Unmodifiable​(AssociativeArray original)
        Copies the provided AssociativeArray and builds a new which is unmodifiable.
        Parameters:
        original -
        Returns:
      • convert2Unmodifiable

        public static AssociativeArray convert2Unmodifiable​(AssociativeArray original)
        Converts the internal data of the provided AssociativeArray to unmondifiable but it does not copy its values. This means that if the original AssociativeArray gets modified, the data of the new object will be modified too. This method is not as safe as copy2Unmodifiable() but it should be preferred when speed is crucial.
        Parameters:
        original -
        Returns:
      • overwrite

        public final void overwrite​(Map<Object,​Object> data)
        Overwrites the contents of the internal data of this object with the ones of the provided map.
        Parameters:
        data -
      • addValues

        public final void addValues​(AssociativeArray array)
        Adds the provided associative array to the current object. All the columns of this object should be numeric or boolean or else an exception is thrown.
        Parameters:
        array -
      • subtractValues

        public final void subtractValues​(AssociativeArray array)
        Subtracts the provided associative array to the current object. All the columns of this object should be numeric or boolean or else an exception is thrown.
        Parameters:
        array -
      • multiplyValues

        public final void multiplyValues​(double multiplier)
        Multiplies the values of the object with a particular multiplier. All the columns of this object should be numeric or boolean or else an exception is thrown.
        Parameters:
        multiplier -
      • remove

        public final Object remove​(Object key)
        Removes a particular key from the internal map and returns the value associated with that key if present in the map.
        Parameters:
        key -
        Returns:
      • get

        public final Object get​(Object key)
        Returns the value which is associated with the provided key.
        Parameters:
        key -
        Returns:
      • getDouble

        public final Double getDouble​(Object key)
        Gets value of the particular key from the map and converts it into a Double. If not found null is returned. The value must be numeric or boolean or else an exception is thrown.
        Parameters:
        key -
        Returns:
      • put

        public final Object put​(Object key,
                                Object value)
        Adds a particular key-value into the internal map. It returns the previous value which was associated with that key.
        Parameters:
        key -
        value -
        Returns:
      • putAll

        public void putAll​(Map<? extends Object,​? extends Object> m)
        Adds all the key-value combinations of the provided map in the internal map.
        Parameters:
        m -
      • entrySet

        public final Set<Map.Entry<Object,​Object>> entrySet()
        Returns the entrySet of the internal map.
        Returns:
      • keySet

        public final Set<Object> keySet()
        Returns the keySet of the internal map.
        Returns:
      • values

        public final Collection<Object> values()
        Returns the values of the internal map.
        Returns:
      • toFlatDataCollection

        public FlatDataCollection toFlatDataCollection()
        Returns a FlatDataCollection with the values of the internal map. The method does not copy the data.
        Returns:
      • toFlatDataList

        public FlatDataList toFlatDataList()
        Returns a FlatDataList with the values of the internal map. The method might require to copy the data.
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object