Class BDMapImpl

java.lang.Object
jmt.framework.data.BDMapImpl
All Implemented Interfaces:
BDMap

public class BDMapImpl extends Object implements BDMap
Created by IntelliJ IDEA. User: orsotronIII Date: 14-giu-2005 Time: 13.46.33 To change this template use Options | File Templates.
  • Field Summary

    Fields inherited from interface BDMap

    X, Y
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • 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.
    static void
    main(String[] args)
     
    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.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BDMapImpl

      public BDMapImpl()
  • Method Details

    • keySet

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

      public boolean containsKey(Object key, int coordName)
      tells whether a key mapping is present in this BDMap along a specified coord
      Specified by:
      containsKey in interface BDMap
      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

      public boolean isEmpty()
      Tells whether this BDMap is empty.
      Specified by:
      isEmpty in interface BDMap
    • put

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

      public 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
      Specified by:
      put in interface BDMap
      Parameters:
      key - : key along specified coordinate.
      coordName - : coordinate along which mapping should be added.
      newMap - : new row or column to be added.
    • remove

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

      public Map remove(Object key, int coordName)
      Removes an entry from this BDMap, given the two search keys pointing to it.
      Specified by:
      remove in interface BDMap
      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

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

      public Map get(Object key, int coordName)
      Description copied from interface: BDMap
      Returns a row or a column contained into this BDMap, given the search key pointing to it and the coordname this key refers to.
      Specified by:
      get in interface BDMap
      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

      public 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.
      Specified by:
      size in interface BDMap
      Parameters:
      coordName - : name of the coordinate along which size must be given
      Returns:
      the resulting int
    • main

      public static void main(String[] args)