Interface ICacheKey
- All Superinterfaces:
Cloneable
,Serializable
- All Known Subinterfaces:
IAliasKey
Title:
Description:
Copyright: Copyright (c) 2000
Company:
The ICacheKey is the "key" to how the cache works. (HA HA)
The first 3 keys..A,B and Name.. are combined to form the
primary key using a hash algorithm.
The secondKey is used when you need to cache multiple objects
with the same primary key, for instance paging.
You can also set the primary key directly, but then you
run the risk of hash collisions. Using 2 of the 4 main fields
is recommended to avoid collisions.
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
create a new cache keyint
getKeyA()
int
getKeyB()
int
int
void
setKeyA
(int keyA) sets keyAvoid
setKeyB
(int keyB) sets keyBvoid
setKeyName
(String keyName) sets keyName limit of 100 ANSI charactersvoid
setPrimaryKey
(int pkey) If you set primary key, then keys A,B and Name will be assumed to be 0/null and not used.void
setSecondKey
(int skey) sets secondary key
-
Method Details
-
setKeyA
sets keyA- Throws:
CacheException
- if primary key has been set
-
setKeyB
sets keyB- Throws:
CacheException
-
setKeyName
sets keyName limit of 100 ANSI characters- Parameters:
keyName
- limit 100 ANSI chars- Throws:
CacheException
-
setSecondKey
void setSecondKey(int skey) sets secondary key- Parameters:
skey
- secondary key
-
setPrimaryKey
void setPrimaryKey(int pkey) If you set primary key, then keys A,B and Name will be assumed to be 0/null and not used.- Parameters:
pkey
- primary key
-
getKeyA
int getKeyA()- Returns:
- key A
-
getKeyB
int getKeyB()- Returns:
- key B
-
getKeyName
String getKeyName()- Returns:
- Name
-
getSecondKey
int getSecondKey()- Returns:
- secondary key
-
getPrimaryKey
int getPrimaryKey()- Returns:
- primary key
-
copy
ICacheKey copy()create a new cache key- Returns:
-