GemFire 5.7.1

com.gemstone.gemfire.cache
Interface Region.Entry

All Superinterfaces:
Map.Entry
Enclosing interface:
Region

public static interface Region.Entry
extends Map.Entry

A key-value pair containing the cached data in a region. This object's operations (except for{Entry#setValue()}), are not distributed, do not acquire any locks, and do not affect CacheStatistics.

Unless otherwise noted, all of these methods throw a CacheClosedException if the Cache is closed at the time of invocation, or an EntryDestroyedException if the entry has been destroyed.


Method Summary
 Object getKey()
          Returns the key for this entry.
 Region getRegion()
          Returns the region that contains this entry.
 CacheStatistics getStatistics()
          Returns the statistics for this entry.
 Object getUserAttribute()
          Returns the user attribute for this entry in the local cache.
 Object getValue()
          Returns the value of this entry in the local cache.
 boolean isDestroyed()
          Returns whether this entry has been destroyed.
 boolean isLocal()
          This method checks to see if the entry is in the in-process cache, or is in another process.
 Object setUserAttribute(Object userAttribute)
          Sets the user attribute for this entry.
 Object setValue(Object value)
          Sets the value of this entry.
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 

Method Detail

getKey

Object getKey()
Returns the key for this entry.

Specified by:
getKey in interface Map.Entry
Returns:
the key for this entry

getValue

Object getValue()
Returns the value of this entry in the local cache. Does not invoke a CacheLoader, does not do a netSearch, netLoad, etc.

Specified by:
getValue in interface Map.Entry
Returns:
the value or null if this entry is invalid

getRegion

Region getRegion()
Returns the region that contains this entry.

Returns:
the Region that contains this entry

isLocal

boolean isLocal()
This method checks to see if the entry is in the in-process cache, or is in another process. Only Regions with DataPolicy.PARTITION may return false in response to this query. A non-local Entry will not reflect dynamic changes being made to the cache. For instance, the result of getValue() will not change, even though the cache may have been updated for the corresponding key. To see an updated snapshot of a non-local Entry, you must fetch the entry from the Region again.


getStatistics

CacheStatistics getStatistics()
Returns the statistics for this entry.

Returns:
the CacheStatistics for this entry
Throws:
StatisticsDisabledException - if statistics have been disabled for this region

getUserAttribute

Object getUserAttribute()
Returns the user attribute for this entry in the local cache.

Returns:
the user attribute for this entry

setUserAttribute

Object setUserAttribute(Object userAttribute)
Sets the user attribute for this entry. Does not distribute the user attribute to other caches.

Parameters:
userAttribute - the user attribute for this entry
Returns:
the previous user attribute or null no user attributes has been set for this entry

isDestroyed

boolean isDestroyed()
Returns whether this entry has been destroyed.

Does not throw a EntryDestroyedException if this entry has been destroyed.

Returns:
true if this entry has been destroyed

setValue

Object setValue(Object value)
Sets the value of this entry. It has similar to calling a put on the key of this Entry

Specified by:
setValue in interface Map.Entry
Parameters:
value - Object the value to be set
Returns:
the previous value object associated with this entry. In some cases CacheEvent.NOT_AVAILABLE may be returned.
Since:
5.0
See Also:
Region.put(Object, Object)

GemFire 5.7.1

Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.