Package com.sun.jini.lease
Class AbstractLeaseMap
java.lang.Object
com.sun.jini.lease.AbstractLeaseMap
- Direct Known Subclasses:
LandlordLeaseMap,SpaceLeaseMap
A base class for implementing LeaseMaps. This class implements all of the Map methods, and
ensures keys and values are of the correct type. The subclass is responsible for implementing the
actual LeaseMap methods: canContainKey, renewAll, and cancelAll, and serialization of any
subclass state.
- Author:
- Sun Microsystems, Inc.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractLeaseMap(Map map) Provide a map of your choice.protectedAbstractLeaseMap(Map map, Lease lease, long duration) Provide a map of your choice.protectedAbstractLeaseMap(Lease lease, long duration) Default to using a small HashMap. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCheck that the key is valid for this mapprotected static voidcheckValue(Object value) Check that the value is a Longvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleaninthashCode()booleanisEmpty()keySet()voidintsize()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.jini.core.lease.LeaseMap
cancelAll, canContainKey, renewAllMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
map
Map from Lease to Long(duration), where all leases have the same destination.
-
-
Constructor Details
-
AbstractLeaseMap
Provide a map of your choice. -
AbstractLeaseMap
Default to using a small HashMap. It is assumed that canContainKey(lease) is true. -
AbstractLeaseMap
Provide a map of your choice. It is assumed that canContainKey(lease) is true.
-
-
Method Details
-
checkKey
Check that the key is valid for this map -
checkValue
Check that the value is a Long -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap
-
containsValue
- Specified by:
containsValuein interfaceMap
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode()
-