Interface BDMap

All Known Implementing Classes:
BDMapImpl

public interface BDMap
Created by IntelliJ IDEA. User: orsotronIII Date: 13-giu-2005 Time: 15.51.14 This interface provides methods for implementation of a bi-dimensional hash map. This type of data structure must provide a set of entries acessed through a combination of two search key. It is a sort of table in which objects are accessed via a couple of objects (representing a search key) instead of a couple of indices.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    code for x coordinate
    static final int
    code for y coordinate
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    containsKey(Object key, int coordName)
    tells whether a key mapping is present in this BDMap along a specified coord
    get(Object key, int coordName)
    Returns a row or a column contained into this BDMap, given the search key pointing to it and the coordname this key refers to.
    get(Object keyX, Object keyY)
    Returns an object contained into this BDMAp, given the two search keys pointing to it.
    boolean
    Tells whether this BDMap is empty.
    keySet(int coordName)
    returns keyset along a single dimension.
    void
    put(Object key, int coordName, Map newMap)
    Puts a map into this BDMap, e.g.
    void
    put(Object keyX, Object keyY, Object value)
    Puts a value into this BDMap, given keys along the two coordinates
    remove(Object key, int coordName)
    Removes an entry from this BDMap, given the two search keys pointing to it.
    remove(Object keyX, Object keyY)
    Removes an entry from this BDMAp, given the two search keys pointing to it.
    int
    size(int coordName)
    returns size of this BDMap along specified coordinate.
  • Field Details

  • Method Details

    • keySet

      Set<Object> keySet(int coordName)
      returns keyset along a single dimension.
      Parameters:
      coordName - name of dimension.
      Returns:
      set containing search keys for specified dimension.
    • containsKey

      boolean containsKey(Object key, int coordName)
      tells whether a key mapping is present in this BDMap along a specified coord
      Parameters:
      key - : key to be searched.
      coordName - : name of coordinate along which search must be performed.
      Returns:
      : true if mapping for specified key has been defined, false otherwise.
    • isEmpty

      boolean isEmpty()
      Tells whether this BDMap is empty.
    • put

      void put(Object keyX, Object keyY, Object value)
      Puts a value into this BDMap, given keys along the two coordinates
      Parameters:
      keyX - : key along x coordinate.
      keyY - : key along y coordinate.
      value - : value to be stored inside bdmap.
    • put

      void put(Object key, int coordName, Map newMap)
      Puts a map into this BDMap, e.g. puts a row or a column into the table represented by this BDMap. If, for example, a map is to be added on the X coordinate, this hashmap should contain mapping for each entry along Y coordinate, otherwise new mapping (returning null value) are created. All of the mappings contained inside given map and not defined along Y coord will be deleted
      Parameters:
      key - : key along specified coordinate.
      coordName - : coordinate along which mapping should be added.
      newMap - : new row or column to be added.
    • remove

      Object remove(Object keyX, Object keyY)
      Removes an entry from this BDMAp, given the two search keys pointing to it.
      Parameters:
      keyX - : key along x coordinate.
      keyY - : key along y coordinate.
      Returns:
      : object removed from bdmap.
    • remove

      Map remove(Object key, int coordName)
      Removes an entry from this BDMap, given the two search keys pointing to it.
      Parameters:
      key - : key along specified coordinate.
      coordName - : coordinate along which mapping should be removed.
      Returns:
      : map containing objects removed from this BDMap. Returned map contains mappings for the other coordinate search keys
    • get

      Object get(Object keyX, Object keyY)
      Returns an object contained into this BDMAp, given the two search keys pointing to it.
      Parameters:
      keyX - : key along x coordinate.
      keyY - : key along y coordinate.
      Returns:
      : object searched from bdmap.
    • get

      Map get(Object key, int coordName)
      Returns a row or a column contained into this BDMap, given the search key pointing to it and the coordname this key refers to.
      Parameters:
      key - : key along specified coordinate.
      coordName - : coordinate along which mapping should be returned.
      Returns:
      : map containing objects contained into this BDMap. Returned map contains mappings for the other coordinate search keys
    • size

      int size(int coordName)
      returns size of this BDMap along specified coordinate. For example, if x coordinate is specified, where x is the coordinate for cells in a row of table represented by this BDMap, total number of columns is returned.
      Parameters:
      coordName - : name of the coordinate along which size must be given