public class MultiMapProxyImpl extends FactoryAwareNamedProxy implements MultiMapProxy, DataSerializable, IGetAwareProxy
Instance.InstanceType
factory, name
Constructor and Description |
---|
MultiMapProxyImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addEntryListener(EntryListener entryListener,
boolean includeValue)
Adds an entry listener for this multimap.
|
void |
addEntryListener(EntryListener entryListener,
Object key,
boolean includeValue)
Adds the specified entry listener for the specified key.
|
void |
addLocalEntryListener(EntryListener entryListener)
Adds a local entry listener for this multimap.
|
void |
clear()
Clears the multimap.
|
boolean |
containsEntry(Object key,
Object value)
Returns whether the multimap contains the given key-value pair.
|
boolean |
containsKey(Object key)
Returns whether the multimap contains an entry with the key.
|
boolean |
containsValue(Object value)
Returns whether the multimap contains an entry with the value.
|
void |
destroy()
Destroys this instance cluster-wide.
|
Set |
entrySet()
Returns the set of key-value pairs in the multimap.
|
boolean |
equals(Object o) |
Collection |
get(Object key)
Returns the collection of values associated with the key.
|
com.hazelcast.impl.MultiMapProxyImpl.MultiMapReal |
getBase() |
Object |
getId()
Returns the unique id for this instance.
|
Instance.InstanceType |
getInstanceType()
Returns instance type such as map, set, list, lock, topic, multimap, id generator
|
LocalMapStats |
getLocalMultiMapStats()
Returns LocalMultiMapStats for this map.
|
String |
getLongName() |
MProxy |
getMProxy() |
String |
getName()
Returns the name of this multimap.
|
int |
hashCode() |
Set |
keySet()
Returns the set of keys in the multimap.
|
Set |
localKeySet()
Returns the locally owned set of keys.
|
void |
lock(Object key)
Acquires the lock for the specified key.
|
boolean |
lockMap(long time,
TimeUnit timeunit)
Tries to acquire the lock for the entire map.
|
boolean |
put(Object key,
Object value)
Stores a key-value pair in the multimap.
|
Collection |
remove(Object key)
Removes all the entries with the given key.
|
boolean |
remove(Object key,
Object value)
Removes the given key value pair from the multimap.
|
void |
removeEntryListener(EntryListener entryListener)
Removes the specified entry listener
Returns silently if there is no such listener added before.
|
void |
removeEntryListener(EntryListener entryListener,
Object key)
Removes the specified entry listener for the specified key.
|
int |
size()
Returns the number of key-value pairs in the multimap.
|
String |
toString() |
boolean |
tryLock(Object key)
Tries to acquire the lock for the specified key.
|
boolean |
tryLock(Object key,
long time,
TimeUnit timeunit)
Tries to acquire the lock for the specified key.
|
void |
unlock(Object key)
Releases the lock for the specified key.
|
void |
unlockMap()
Unlocks the map.
|
int |
valueCount(Object key)
Returns number of values matching to given key in the multimap.
|
Collection |
values()
Returns the collection of values in the multimap.
|
getFactory, readData, setHazelcastInstance, setName, writeData
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
setHazelcastInstance
readData, writeData
public com.hazelcast.impl.MultiMapProxyImpl.MultiMapReal getBase()
public MProxy getMProxy()
getMProxy
in interface MultiMapProxy
public LocalMapStats getLocalMultiMapStats()
MultiMap
getLocalMultiMapStats
in interface MultiMap
public String getLongName()
getLongName
in interface MultiMapProxy
public Object getId()
Instance
public Instance.InstanceType getInstanceType()
Instance
getInstanceType
in interface Instance
public void destroy()
Instance
public String getName()
MultiMap
getName
in interface MultiMap
getName
in class FactoryAwareNamedProxy
public boolean put(Object key, Object value)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
public Collection get(Object key)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
Warning-2:
The collection is NOT backed by the map, so changes to the map are NOT reflected in the collection, and vice-versa.get
in interface MultiMap
get
in interface IGetAwareProxy
key
- the key whose associated values are to be returnedpublic boolean remove(Object key, Object value)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public Collection remove(Object key)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
Warning-2:
The collection is NOT backed by the map, so changes to the map are NOT reflected in the collection, and vice-versa.public Set localKeySet()
MultiMap
Warning:
The set is NOT backed by the map, so changes to the map are NOT reflected in the set, and vice-versa.localKeySet
in interface MultiMap
public Set keySet()
MultiMap
Warning:
The set is NOT backed by the map, so changes to the map are NOT reflected in the set, and vice-versa.public Collection values()
MultiMap
Warning:
The collection is NOT backed by the map, so changes to the map are NOT reflected in the collection, and vice-versa.public Set entrySet()
MultiMap
Warning:
The set is NOT backed by the map, so changes to the map are NOT reflected in the set, and vice-versa.public boolean containsKey(Object key)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
containsKey
in interface MultiMap
key
- the key whose existence is checked.public boolean containsValue(Object value)
MultiMap
containsValue
in interface MultiMap
value
- the value whose existence is checked.public boolean containsEntry(Object key, Object value)
MultiMap
containsEntry
in interface MultiMap
key
- the key whose existence is checked.value
- the value whose existence is checked.public int size()
MultiMap
public void clear()
MultiMap
public int valueCount(Object key)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
valueCount
in interface MultiMap
key
- the key whose values count are to be returnedpublic void addLocalEntryListener(EntryListener entryListener)
MultiMap
multimap.put(key2, value2)
.
If the key2 is owned by member2 then the local listener will be
notified for the add/update event. Also note that entries can migrate to
other nodes for load balancing and/or membership change.addLocalEntryListener
in interface MultiMap
entryListener
- entry listenerMultiMap.localKeySet()
public void addEntryListener(EntryListener entryListener, boolean includeValue)
MultiMap
addEntryListener
in interface MultiMap
entryListener
- entry listenerincludeValue
- true if EntryEvent should
contain the value.public void removeEntryListener(EntryListener entryListener)
MultiMap
removeEntryListener
in interface MultiMap
entryListener
- entry listenerpublic void addEntryListener(EntryListener entryListener, Object key, boolean includeValue)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
addEntryListener
in interface MultiMap
entryListener
- entry listenerkey
- the key to listenincludeValue
- true if EntryEvent should
contain the value.public void removeEntryListener(EntryListener entryListener, Object key)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
removeEntryListener
in interface MultiMap
public void lock(Object key)
MultiMap
If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired.
Scope of the lock is this multimap only. Acquired lock is only for the key in this multimap. Locks are re-entrant so if the key is locked N times then it should be unlocked N times before another thread can acquire it.Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
public boolean tryLock(Object key)
MultiMap
If the lock is not available then the current thread doesn't wait and returns false immediately.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
public boolean tryLock(Object key, long time, TimeUnit timeunit)
MultiMap
If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
public void unlock(Object key)
MultiMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
public boolean lockMap(long time, TimeUnit timeunit)
MultiMap
If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
Copyright © 2013 Hazelcast, Inc.. All rights reserved.