コード例 #1
0
ファイル: ClientRoute.java プロジェクト: Coselding/Openfire
 @Override
 public int getCachedSize() {
   // Approximate the size of the object in bytes by calculating the size
   // of each field.
   int size = 0;
   size += CacheSizes.sizeOfObject(); // overhead of object
   size += nodeID.toByteArray().length; // Node ID
   size += CacheSizes.sizeOfBoolean(); // available
   return size;
 }
コード例 #2
0
ファイル: PrivacyList.java プロジェクト: team-lab/openfire
 public int getCachedSize() throws CannotCalculateSizeException {
   // Approximate the size of the object in bytes by calculating the size
   // of each field.
   int size = 0;
   size += CacheSizes.sizeOfObject(); // overhead of object
   size += CacheSizes.sizeOfString(userJID.toString()); // userJID
   size += CacheSizes.sizeOfString(name); // name
   size += CacheSizes.sizeOfBoolean(); // isDefault
   size += CacheSizes.sizeOfCollection(items); // items of the list
   return size;
 }
コード例 #3
0
ファイル: RosterItem.java プロジェクト: team-lab/openfire
 /*
  * (non-Javadoc)
  *
  * @see org.jivesoftware.util.cache.Cacheable#getCachedSize()
  */
 public int getCachedSize() throws CannotCalculateSizeException {
   int size = jid.toBareJID().length();
   size += CacheSizes.sizeOfString(nickname);
   size += CacheSizes.sizeOfCollection(groups);
   size += CacheSizes.sizeOfCollection(invisibleSharedGroups);
   size += CacheSizes.sizeOfCollection(sharedGroups);
   size += CacheSizes.sizeOfInt(); // subStatus
   size += CacheSizes.sizeOfInt(); // askStatus
   size += CacheSizes.sizeOfInt(); // recvStatus
   size += CacheSizes.sizeOfLong(); // id
   return size;
 }
コード例 #4
0
ファイル: User.java プロジェクト: clin9ame/clin9ame
 public int getCachedSize() throws CannotCalculateSizeException {
   // Approximate the size of the object in bytes by calculating the size
   // of each field.
   int size = 0;
   size += CacheSizes.sizeOfObject(); // overhead of object
   size += CacheSizes.sizeOfLong(); // id
   size += CacheSizes.sizeOfString(username); // username
   size += CacheSizes.sizeOfString(name); // name
   size += CacheSizes.sizeOfString(email); // email
   size += CacheSizes.sizeOfDate() * 2; // creationDate and modificationDate
   size += CacheSizes.sizeOfMap(properties); // properties
   return size;
 }