Clover coverage report - Coverage timestamp: do jan 22 2004 21:12:32 CET FRAMES NO FRAMES |
file stats: | LOC: | 70 |  | Methods: | 5
| NCLOC: | 23 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
CachePatternEvent.java | - | 42,9% | 20% | 33,3% |

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 |  |
9 |  |
     /**
10 |  |
      * A CachePatternEvent is fired when a pattern has been applied to a cache.
11 |  |
      *
12 |  |
      * @version        $Revision: 1.1 $
13 |  |
      * @author <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
14 |  |
      */
15 |  |
     public final class CachePatternEvent extends CacheEvent {
16 |  |
         /**
17 |  |
          * The cache the pattern is being applied to.
18 |  |
          */
19 |  |
         private Cache map = null;
20 |  |
21 |  |
         /**
22 |  |
          * The pattern that is being applied.
23 |  |
          */
24 |  |
         private String pattern = null;
25 |  |
26 |  |
         /**
27 |  |
          * Constructs a cache pattern event with no origin
28 |  |
          *
29 |  |
          * @param map     The cache map that the pattern was applied to
30 |  |
          * @param pattern The pattern that was applied
31 |  |
          */
32 | 0 |
         public CachePatternEvent(Cache map, String pattern) {
33 | 0 |
             this(map, pattern, null);
34 |  |
         }
35 |  |
36 |  |
         /**
37 |  |
          * Constructs a cache pattern event
38 |  |
          *
39 |  |
          * @param map     The cache map that the pattern was applied to
40 |  |
          * @param pattern The cache pattern that the event applies to.
41 |  |
          * @param origin  An optional tag that can be attached to the event to
42 |  |
          * specify the event's origin. This is useful to prevent events from being
43 |  |
          * fired recursively in some situations, such as when an event handler
44 |  |
          * causes another event to be fired, or for logging purposes.
45 |  |
          */
46 | 21 |
         public CachePatternEvent(Cache map, String pattern, String origin) {
47 | 21 |
             super(origin);
48 | 21 |
             this.map = map;
49 | 21 |
             this.pattern = pattern;
50 |  |
         }
51 |  |
52 |  |
         /**
53 |  |
          * Retrieve the cache map that had the pattern applied.
54 |  |
          */
55 | 0 |
         public Cache getMap() {
56 | 0 |
             return map;
57 |  |
         }
58 |  |
59 |  |
         /**
60 |  |
          * Retrieve the pattern that was applied to the cache.
61 |  |
          */
62 | 0 |
         public String getPattern() {
63 | 0 |
             return pattern;
64 |  |
         }
65 |  |
66 | 0 |
         public String toString() {
67 | 0 |
             return "pattern=" + pattern;
68 |  |
         }
69 |  |
     }
70 |  |