|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.util.QSHashMap
A QSHashMap
is a wrapper class of HashMap
that implements QuickSerializable
. All elements of the
QSHashMap
must also be QuickSerializable
.
Most of the functionality from the HashMap
has not been
ported. If you require the use of a missing method, implement it.
Constructor Summary | |
---|---|
QSHashMap()
Constructs a QSHashMap . |
|
QSHashMap(InputBuffer buffer)
Constructs a QSHashMap from its
serialized form. |
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this set. |
boolean |
containsKey(QuickSerializable o)
Returns true if this map contains the specified key. |
boolean |
containsValue(QuickSerializable o)
Returns true if this map contains the specified value. |
boolean |
equals(Object o)
Compare this QSHashMap to another Object . |
QuickSerializable |
get(QuickSerializable o)
Returns the object mapped to the given key in this map if it is present. |
protected HashMap |
getHashMap()
|
int |
hashCode()
Return a hashcode, specified and generated as in HashMap . |
boolean |
isEmpty()
Returns true if this map contains no mappings. |
Set |
keySet()
Returns a set view of the keys contained in this map. |
QuickSerializable |
put(QuickSerializable key,
QuickSerializable value)
Puts this mapping in the map |
QuickSerializable |
remove(QuickSerializable o)
Removes the given key mapping from this map if it is present. |
void |
serialize(OutputBuffer buffer)
As specified by {link ostore.util.QuickSerializable}. |
int |
size()
Returns the number of mappings in this map. |
Collection |
values()
Returns a collection view of the values contained in this map. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QSHashMap()
QSHashMap
.
public QSHashMap(InputBuffer buffer) throws QSException
QSHashMap
from its
serialized
form.
buffer
- serialized
form of object.Method Detail |
public void serialize(OutputBuffer buffer)
serialize
in interface QuickSerializable
buffer
- the output buffer to add the object topublic int hashCode()
HashMap
.
hashCode
in class Object
QSTreeSet
protected HashMap getHashMap()
public boolean equals(Object o)
QSHashMap
to another Object
.
equals
in class Object
true
iff the other Object
is also a
QSHashMap
and contains equal
elements.public Set keySet()
public Collection values()
public int size()
public boolean isEmpty()
public boolean containsKey(QuickSerializable o)
o
- the key to be checked for containment in this map.
ClassCastException
- if the specified object cannot be compared
with the elements currently in the map.public boolean containsValue(QuickSerializable o)
o
- the value to be checked for containment in this map.
ClassCastException
- if the specified object cannot be compared
with the elements currently in the map.public QuickSerializable put(QuickSerializable key, QuickSerializable value)
ClassCastException
- if the specified object cannot be compared
with the elements currently in the set.public QuickSerializable get(QuickSerializable o)
o
- key to lookup
ClassCastException
- if the specified object cannot be compared
with the elements currently in the set.public QuickSerializable remove(QuickSerializable o)
o
- key of the mapping to be removed from this map, if present.
ClassCastException
- if the specified object cannot be compared
with the elements currently in the set.public void clear()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |