Class ThincSMsgFlagCache

java.lang.Object
  extended by ThincSMsgFlag
      extended by ThincSMsgFlagCache
All Implemented Interfaces:
ThincMsgFlag

public final class ThincSMsgFlagCache
extends ThincSMsgFlag

class for cache flag message. receives cache message and puts/gets the object to/from the cache by id from server.

Author:
Young Jin Yoon
See Also:
ThincSMsgFlag, ThincSMsgFBRawUpdate

Field Summary
static int ADD_MESSAGE_SIZE
           
private  ThincClientCanvas canvas
           
static int DATA_MESSAGE_SIZE
           
private  ThincMsgHandler handler
           
private  java.nio.ByteBuffer hd
           
private  int id
           
private  int type
           
 
Constructor Summary
ThincSMsgFlagCache(ThincMsgHandler h, ThincClientCanvas c)
          creates ThincSMsgFlagCache object.
 
Method Summary
 void addCache(java.lang.Object target)
          addCache() actually adds the object into cache. the key value and type such as id and type in this class should be already set by setCacheId() method.
 java.lang.Object getCache(int type)
          getCache() gets the object from the cache. the key value(identifier) will be automatically received from this method.
 void setCacheId(int type)
          setCacheId() receives the cache id from network and save it temporary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_MESSAGE_SIZE

public static final int ADD_MESSAGE_SIZE
See Also:
Constant Field Values

DATA_MESSAGE_SIZE

public static final int DATA_MESSAGE_SIZE
See Also:
Constant Field Values

handler

private ThincMsgHandler handler

canvas

private ThincClientCanvas canvas

id

private int id

hd

private java.nio.ByteBuffer hd

type

private int type
Constructor Detail

ThincSMsgFlagCache

public ThincSMsgFlagCache(ThincMsgHandler h,
                          ThincClientCanvas c)
creates ThincSMsgFlagCache object.

Parameters:
h - ThincMsgHandler to handle the message
c - ThincClientCanvas to get the information
Method Detail

setCacheId

public void setCacheId(int type)
                throws ThincException
setCacheId() receives the cache id from network and save it temporary. it will be used in addCache() and methods.

Parameters:
type - cache type defined in ThincClientCanvas
Throws:
ThincException

addCache

public void addCache(java.lang.Object target)
              throws ThincException
addCache() actually adds the object into cache. the key value and type such as id and type in this class should be already set by setCacheId() method.

Parameters:
target - the object to put
Throws:
ThincException

getCache

public java.lang.Object getCache(int type)
                          throws ThincException
getCache() gets the object from the cache. the key value(identifier) will be automatically received from this method.

Parameters:
type - type of the cache
Returns:
the object to get
Throws:
ThincException