Coverage details for edu.uci.ics.jung.graph.impl.BipartiteVertex

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 /*
11  * Created on Dec 28, 2003
12  */
13 package edu.uci.ics.jung.graph.impl;
14  
15 import edu.uci.ics.jung.exceptions.FatalException;
16 import edu.uci.ics.jung.graph.ArchetypeGraph;
17 import edu.uci.ics.jung.graph.ArchetypeVertex;
18  
19 /**
20  *
21  * created Dec 28, 2003
22  *
23  * @author danyelf
24  */
2580public class BipartiteVertex extends SparseVertex {
26  
27     /**
28      * Specialized copy function for copy FROM BipartiteGraph TO BipartiteGraph
29      */
30     public ArchetypeVertex copy(ArchetypeGraph newGraph) {
3117        if (!(newGraph instanceof BipartiteGraph
32             && this.getGraph() instanceof BipartiteGraph)) {
333            return super.copy(newGraph);
34         }
3514        BipartiteGraph bpg = (BipartiteGraph) newGraph;
36  
3714        if (newGraph == this.getGraph())
380            throw new IllegalArgumentException(
39                 "Source and destination graphs " + "must be different");
40  
41         try {
4214            BipartiteVertex v = (BipartiteVertex) clone();
4314            v.initialize();
4414            v.importUserData(this);
4514            BipartiteGraph thisGraph = (BipartiteGraph) this.getGraph();
4614            bpg.addVertex(v, thisGraph.getPartition(this));
4714            return v;
480        } catch (CloneNotSupportedException cne) {
490            throw new FatalException("Can't copy vertex ", cne);
50         }
51     }
52  
53 }

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.