Coverage details for edu.uci.ics.jung.graph.decorators.Decorator

LineHitsSource
1 /*
2 * Copyright (c) 2003, the JUNG Project and the Regents of the University
3 * of California
4 * All rights reserved.
5 *
6 * This software is open-source under the BSD license; see either
7 * "license.txt" or
8 * http://jung.sourceforge.net/license.txt for a description.
9 */
10 package edu.uci.ics.jung.graph.decorators;
11  
12 import edu.uci.ics.jung.utils.UserDataContainer;
13  
14 /**
15  * Abstract decorator for cases where attributes are to be stored along with the graph/edge/vertex which they describe
16  * @author Scott White
17  */
18 public abstract class Decorator {
19     private Object mKey;
20     private UserDataContainer.CopyAction mCopyAction;
21  
22     /**
23      * Constructs and initializes the decorator
24      * @param key
25      * @param action
26      */
2743    protected Decorator(Object key,UserDataContainer.CopyAction action) {
2843        mKey = key;
2943        mCopyAction = action;
3043    }
31  
32     /**
33      * Retrieves the user datum copy action that this decorator uses when setting new values
34      * @return the copy action
35      */
36856    public UserDataContainer.CopyAction getCopyAction() { return mCopyAction; }
37  
38     /**
39      * Retrieves the user datum key that this decorator uses when setting new values
40      */
418036    public Object getKey() { return mKey; }
42  
43     /**
44      * @return the hash code for the user datum key
45      */
46     public int hashCode() {
470        return mKey.hashCode();
48     }
49  
50     /**
51      * Removes the values from the user data container
52      * @param udc the vertex/edge/graph being whose value is being removed
53      */
54     public void removeValue(UserDataContainer udc) {
5577        udc.removeUserDatum(mKey);
5677    }
57 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.