net.ranides.assira.collection.map
Class CrossHashMap<KX,KY,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<KX,HashMap<KY,V>>
          extended by net.ranides.assira.collection.map.CrossHashMap<KX,KY,V>
Type Parameters:
KX -
KY -
V -
All Implemented Interfaces:
Serializable, Cloneable, Map<KX,HashMap<KY,V>>, CrossMap<KX,KY,V>

public class CrossHashMap<KX,KY,V>
extends HashMap<KX,HashMap<KY,V>>
implements CrossMap<KX,KY,V>

Implementacja dwu-wymiarowej mapy używająca wewnętrznie HashMap<HashMap<>>

Author:
ranides
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
CrossHashMap()
          Constructs an empty CrossHashMap with the default initial capacity (16) and the default load factor (0.75).
 
Method Summary
 boolean contains(KX x, KY y)
          Sprawdza, czy zawiera wartość przypisaną do podanych kluczy.
 V get(KX x, KY y)
          Pobiera wartość przypisaną do podanych kluczy.
 V put(KX x, KY y, V value)
          Przypisuje nową wartość do podanych kluczy.
 MultiMap<KX,V> reduceY()
          Redukuje klucz drugiego rzędu i zwraca multi-mapę zawierającą klucze główne i przypisane im wartości
 MultiMap<KX,KY> reduceZ()
          Redukuje przypisane wartości i zwraca multi-mapę zawierającą klucze
 V remove(KX x, KY y)
          Usuwa wartość przypisaną do podanych kluczy.
 int size()
          Zwraca rozmiar mapy.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.ranides.assira.collection.map.CrossMap
clear, isEmpty
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

CrossHashMap

public CrossHashMap()
Constructs an empty CrossHashMap with the default initial capacity (16) and the default load factor (0.75).

Method Detail

contains

public boolean contains(KX x,
                        KY y)
Description copied from interface: CrossMap
Sprawdza, czy zawiera wartość przypisaną do podanych kluczy.

Specified by:
contains in interface CrossMap<KX,KY,V>
Returns:

put

public V put(KX x,
             KY y,
             V value)
Description copied from interface: CrossMap
Przypisuje nową wartość do podanych kluczy.

Specified by:
put in interface CrossMap<KX,KY,V>
Returns:
poprzednio przypisana wartość lub null.

remove

public V remove(KX x,
                KY y)
Description copied from interface: CrossMap
Usuwa wartość przypisaną do podanych kluczy.

Specified by:
remove in interface CrossMap<KX,KY,V>
Returns:
usunięta wartość lub null.

get

public V get(KX x,
             KY y)
Description copied from interface: CrossMap
Pobiera wartość przypisaną do podanych kluczy.

Specified by:
get in interface CrossMap<KX,KY,V>
Returns:
przypisana wartość lub null.

reduceZ

public final MultiMap<KX,KY> reduceZ()
Description copied from interface: CrossMap
Redukuje przypisane wartości i zwraca multi-mapę zawierającą klucze

Specified by:
reduceZ in interface CrossMap<KX,KY,V>
Returns:

reduceY

public final MultiMap<KX,V> reduceY()
Description copied from interface: CrossMap
Redukuje klucz drugiego rzędu i zwraca multi-mapę zawierającą klucze główne i przypisane im wartości

Specified by:
reduceY in interface CrossMap<KX,KY,V>
Returns:

size

public int size()
Description copied from interface: CrossMap
Zwraca rozmiar mapy.

Specified by:
size in interface Map<KX,HashMap<KY,V>>
Specified by:
size in interface CrossMap<KX,KY,V>
Overrides:
size in class HashMap<KX,HashMap<KY,V>>


Copyright © 2013. All Rights Reserved.