GigaSpaces XAP 9.7.2 API

com.sun.jini.lease
Class AbstractLeaseMap

java.lang.Object
  extended by com.sun.jini.lease.AbstractLeaseMap
All Implemented Interfaces:
Map, LeaseMap
Direct Known Subclasses:
LandlordLeaseMap

public abstract class AbstractLeaseMap
extends Object
implements LeaseMap

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
protected  Map map
          Map from Lease to Long(duration), where all leases have the same destination.
 
Constructor Summary
protected AbstractLeaseMap(Lease lease, long duration)
          Default to using a small HashMap.
protected AbstractLeaseMap(Map map)
          Provide a map of your choice.
protected AbstractLeaseMap(Map map, Lease lease, long duration)
          Provide a map of your choice.
 
Method Summary
protected  void checkKey(Object key)
          Check that the key is valid for this map
protected static void checkValue(Object value)
          Check that the value is a Long
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 boolean equals(Object o)
           
 Object get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set keySet()
           
 Object put(Object key, Object value)
           
 void putAll(Map m)
           
 Object remove(Object key)
           
 int size()
           
 Collection values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.jini.core.lease.LeaseMap
cancelAll, canContainKey, renewAll
 

Field Detail

map

protected final Map map
Map from Lease to Long(duration), where all leases have the same destination.

Constructor Detail

AbstractLeaseMap

protected AbstractLeaseMap(Map map)
Provide a map of your choice.


AbstractLeaseMap

protected AbstractLeaseMap(Lease lease,
                           long duration)
Default to using a small HashMap. It is assumed that canContainKey(lease) is true.


AbstractLeaseMap

protected AbstractLeaseMap(Map map,
                           Lease lease,
                           long duration)
Provide a map of your choice. It is assumed that canContainKey(lease) is true.

Method Detail

checkKey

protected void checkKey(Object key)
Check that the key is valid for this map


checkValue

protected static void checkValue(Object value)
Check that the value is a Long


size

public int size()
Specified by:
size in interface Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map

get

public Object get(Object key)
Specified by:
get in interface Map

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map

remove

public Object remove(Object key)
Specified by:
remove in interface Map

putAll

public void putAll(Map m)
Specified by:
putAll in interface Map

clear

public void clear()
Specified by:
clear in interface Map

keySet

public Set keySet()
Specified by:
keySet in interface Map

values

public Collection values()
Specified by:
values in interface Map

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map

equals

public boolean equals(Object o)
Specified by:
equals in interface Map
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map
Overrides:
hashCode in class Object

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.