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 -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key, int coordName) tells whether a key mapping is present in this BDMap along a specified coordReturns a row or a column contained into this BDMap, given the search key pointing to it and the coordname this key refers to.Returns an object contained into this BDMAp, given the two search keys pointing to it.booleanisEmpty()Tells whether this BDMap is empty.keySet(int coordName) returns keyset along a single dimension.voidPuts a map into this BDMap, e.g.voidPuts a value into this BDMap, given keys along the two coordinatesRemoves an entry from this BDMap, given the two search keys pointing to it.Removes an entry from this BDMAp, given the two search keys pointing to it.intsize(int coordName) returns size of this BDMap along specified coordinate.
-
Field Details
-
X
static final int Xcode for x coordinate- See Also:
-
Y
static final int Ycode for y coordinate- See Also:
-
-
Method Details
-
keySet
-
containsKey
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
-
put
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
-
remove
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
-
get
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
-