Class TableMap

  • All Implemented Interfaces:
    Serializable, Cloneable, Map
    Direct Known Subclasses:
    ThreeDimMap

    public class TableMap
    extends LinkedHashMap
    Usefull class for storing 2-dimensional data that needs to be accessed by it's coordinates. The data structure consist of a Map of Maps of Objects. Inner maps are automatically created when putting values. The datastructure uses LinkedHashMaps, so it is order preserving. Use the getEntrySet() method from Map, to iterate over the objects in the order they were added.
    Author:
    jilles
    See Also:
    Serialized Form
    • Constructor Detail

      • TableMap

        public TableMap()
    • Method Detail

      • put

        public void put​(Object outerkey,
                        Object innerkey,
                        Object value)
        Put a value into the tablemap. e.g. put("row1","col2",new Integer(-1));
        Parameters:
        outerkey - key of the outer Map
        innerkey - key of the inner Map
        value -
      • get

        public Object get​(Object outerkey,
                          Object innerkey)
        Retrieve an object.
        Parameters:
        outerkey -
        innerkey -
        Returns:
        the object at the specified location or null if it doesn't exist.