Coverage details for edu.uci.ics.jung.graph.filters.impl.NumericDecorationFilter

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.filters.impl;
11  
12 import edu.uci.ics.jung.graph.Vertex;
13 import edu.uci.ics.jung.graph.filters.GeneralVertexAcceptFilter;
14  
15 /**
16  * This simple filter accepts vertices if their UserData at the given key is
17  * over a threshold value. Note that this depends on user data that
18  * is attached to the vertex.
19  *
20  * @author Scott White
21  */
220public class NumericDecorationFilter extends GeneralVertexAcceptFilter {
23     private double mThreshold;
24     private String mDecorationKey;
25  
26     public boolean acceptVertex(Vertex vertex) {
270        Number n = (Number) vertex.getUserDatum(mDecorationKey);
28  
290        if (n.doubleValue() > mThreshold) {
300            return true;
31         }
320        return false;
33     }
34  
35     public String getName() {
360        return "NumericDecoration";
37     }
38  
39     public String getDecorationKey() {
400        return mDecorationKey;
41     }
42  
43     public void setDecorationKey(String decorationKey) {
440        this.mDecorationKey = decorationKey;
450    }
46  
47     public double getThreshold() {
480        return mThreshold;
49     }
50  
51     public void setThreshold(double threshold) {
520        this.mThreshold = threshold;
530    }
54 }

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.