com.thimbleware.jmemcached
Class LocalCacheElement

java.lang.Object
  extended by com.thimbleware.jmemcached.LocalCacheElement
All Implemented Interfaces:
CacheElement, SizedItem, java.io.Externalizable, java.io.Serializable

public final class LocalCacheElement
extends java.lang.Object
implements CacheElement, java.io.Externalizable

Represents information about a cache entry.

See Also:
Serialized Form

Nested Class Summary
static class LocalCacheElement.IncrDecrResult
           
 
Field Summary
 
Fields inherited from interface com.thimbleware.jmemcached.CacheElement
THIRTY_DAYS
 
Constructor Summary
LocalCacheElement()
           
LocalCacheElement(Key key)
           
LocalCacheElement(Key key, int flags, int expire, long casUnique)
           
 
Method Summary
 LocalCacheElement.IncrDecrResult add(int mod)
           
 LocalCacheElement append(LocalCacheElement appendElement)
           
 void block(long blockedUntil)
           
 boolean equals(java.lang.Object o)
           
 long getBlockedUntil()
           
 long getCasUnique()
           
 org.jboss.netty.buffer.ChannelBuffer getData()
           
 int getExpire()
           
 int getFlags()
           
 Key getKey()
           
 int hashCode()
           
 boolean isBlocked()
           
static LocalCacheElement key(Key key)
           
static int Now()
           
 LocalCacheElement prepend(LocalCacheElement prependElement)
           
 void readExternal(java.io.ObjectInput in)
           
 void setCasUnique(long casUnique)
           
 void setData(org.jboss.netty.buffer.ChannelBuffer data)
           
 int size()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalCacheElement

public LocalCacheElement()

LocalCacheElement

public LocalCacheElement(Key key)

LocalCacheElement

public LocalCacheElement(Key key,
                         int flags,
                         int expire,
                         long casUnique)
Method Detail

Now

public static int Now()
Returns:
the current time in seconds

size

public int size()
Specified by:
size in interface CacheElement
Specified by:
size in interface SizedItem

append

public LocalCacheElement append(LocalCacheElement appendElement)
Specified by:
append in interface CacheElement

prepend

public LocalCacheElement prepend(LocalCacheElement prependElement)
Specified by:
prepend in interface CacheElement

add

public LocalCacheElement.IncrDecrResult add(int mod)
Specified by:
add in interface CacheElement

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface CacheElement
Overrides:
hashCode in class java.lang.Object

key

public static LocalCacheElement key(Key key)

getExpire

public int getExpire()
Specified by:
getExpire in interface CacheElement

getFlags

public int getFlags()
Specified by:
getFlags in interface CacheElement

getData

public org.jboss.netty.buffer.ChannelBuffer getData()
Specified by:
getData in interface CacheElement

getKey

public Key getKey()
Specified by:
getKey in interface CacheElement

getCasUnique

public long getCasUnique()
Specified by:
getCasUnique in interface CacheElement

isBlocked

public boolean isBlocked()
Specified by:
isBlocked in interface CacheElement

getBlockedUntil

public long getBlockedUntil()
Specified by:
getBlockedUntil in interface CacheElement

setCasUnique

public void setCasUnique(long casUnique)
Specified by:
setCasUnique in interface CacheElement

block

public void block(long blockedUntil)
Specified by:
block in interface CacheElement

setData

public void setData(org.jboss.netty.buffer.ChannelBuffer data)
Specified by:
setData in interface CacheElement

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException


Copyright © 2008-2011 ThimbleWare. All Rights Reserved.