Class AssociativeArray2D
- java.lang.Object
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructure<T>
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructureMap<Map<Object,AssociativeArray>>
-
- com.datumbox.framework.common.dataobjects.AssociativeArray2D
-
- All Implemented Interfaces:
Copyable<AssociativeArray2D>,Serializable
- Direct Known Subclasses:
DataTable2D
public class AssociativeArray2D extends AbstractDataStructureMap<Map<Object,AssociativeArray>> implements Copyable<AssociativeArray2D>
Data structure which stores internally a Map- Author:
- Vasilis Vryniotis
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.datumbox.framework.common.dataobjects.AbstractDataStructure
internalData
-
-
Constructor Summary
Constructors Constructor Description AssociativeArray2D()Default constructor which initializes the internal data with a LinkedHashMap.AssociativeArray2D(Map<Object,AssociativeArray> internalData)Constructor that initializes the internal data with the provided map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AssociativeArray2Dcopy()Copies itself and returns a new instance of the same type.Set<Map.Entry<Object,AssociativeArray>>entrySet()Returns the entrySet of the internal map.booleanequals(Object o)AssociativeArrayget(Object key)Returns the value which is associated with the provided key.Objectget2d(Object key1, Object key2)Convenience function to get the value by using both keys.inthashCode()Set<Object>keySet()Returns the keySet of the internal map.AssociativeArrayput(Object key, AssociativeArray value)Adds a particular key-value into the internal map.Objectput2d(Object key1, Object key2, Object value)Convenience function used to put a value in a particular key positions.AssociativeArrayremove(Object key)Removes a particular key from the internal map and returns the value associated with that key if present in the map.Collection<AssociativeArray>values()Returns the values of the internal map.-
Methods inherited from class com.datumbox.framework.common.dataobjects.AbstractDataStructureMap
clear, containsKey, isEmpty, size
-
-
-
-
Constructor Detail
-
AssociativeArray2D
public AssociativeArray2D()
Default constructor which initializes the internal data with a LinkedHashMap.
-
AssociativeArray2D
public AssociativeArray2D(Map<Object,AssociativeArray> internalData)
Constructor that initializes the internal data with the provided map.- Parameters:
internalData-
-
-
Method Detail
-
copy
public AssociativeArray2D copy()
Copies itself and returns a new instance of the same type.- Specified by:
copyin interfaceCopyable<AssociativeArray2D>- Returns:
-
remove
public final AssociativeArray 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 AssociativeArray get(Object key)
Returns the value which is associated with the provided key.- Parameters:
key-- Returns:
-
put
public final AssociativeArray put(Object key, AssociativeArray 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:
-
entrySet
public final Set<Map.Entry<Object,AssociativeArray>> entrySet()
Returns the entrySet of the internal map.- Returns:
-
values
public final Collection<AssociativeArray> values()
Returns the values of the internal map.- Returns:
-
get2d
public final Object get2d(Object key1, Object key2)
Convenience function to get the value by using both keys.- Parameters:
key1-key2-- Returns:
-
put2d
public final Object put2d(Object key1, Object key2, Object value)
Convenience function used to put a value in a particular key positions.- Parameters:
key1-key2-value-- Returns:
-
-