Clover coverage report -
Coverage timestamp: do jan 22 2004 21:12:32 CET
file stats: LOC: 77   Methods: 6
NCLOC: 27   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
CacheEntryEvent.java - 75% 66,7% 71,4%
coverage coverage
 1   
 /*
 2   
  * Copyright (c) 2002-2003 by OpenSymphony
 3   
  * All rights reserved.
 4   
  */
 5   
 package com.opensymphony.oscache.base.events;
 6   
 
 7   
 import com.opensymphony.oscache.base.Cache;
 8   
 import com.opensymphony.oscache.base.CacheEntry;
 9   
 
 10   
 /**
 11   
  * CacheEntryEvent is the object created when an event occurs on a
 12   
  * cache entry (Add, update, remove, flush). It contains the entry itself and
 13   
  * its map.
 14   
  *
 15   
  * @version        $Revision: 1.1 $
 16   
  * @author <a href="mailto:fbeauregard@pyxis-tech.com">Francois Beauregard</a>
 17   
  */
 18   
 public final class CacheEntryEvent extends CacheEvent {
 19   
     /**
 20   
      * The cache where the entry resides.
 21   
      */
 22   
     private Cache map = null;
 23   
 
 24   
     /**
 25   
      * The entry that the event applies to.
 26   
      */
 27   
     private CacheEntry entry = null;
 28   
 
 29   
     /**
 30   
      * Constructs a cache entry event object with no specified origin
 31   
      *
 32   
      * @param map     The cache map of the cache entry
 33   
      * @param entry   The cache entry that the event applies to
 34   
      */
 35  0
     public CacheEntryEvent(Cache map, CacheEntry entry) {
 36  0
         this(map, entry, null);
 37   
     }
 38   
 
 39   
     /**
 40   
      * Constructs a cache entry event object
 41   
      *
 42   
      * @param map     The cache map of the cache entry
 43   
      * @param entry   The cache entry that the event applies to
 44   
      * @param origin  The origin of this event
 45   
      */
 46  255
     public CacheEntryEvent(Cache map, CacheEntry entry, String origin) {
 47  255
         super(origin);
 48  255
         this.map = map;
 49  255
         this.entry = entry;
 50   
     }
 51   
 
 52   
     /**
 53   
      * Retrieve the cache entry that the event applies to.
 54   
      */
 55  6
     public CacheEntry getEntry() {
 56  6
         return entry;
 57   
     }
 58   
 
 59   
     /**
 60   
      * Retrieve the cache entry key
 61   
      */
 62  6
     public String getKey() {
 63  6
         return entry.getKey();
 64   
     }
 65   
 
 66   
     /**
 67   
      * Retrieve the cache map where the entry resides.
 68   
      */
 69  6
     public Cache getMap() {
 70  6
         return map;
 71   
     }
 72   
 
 73  0
     public String toString() {
 74  0
         return "key=" + entry.getKey();
 75   
     }
 76   
 }
 77