| Line | Hits | Source |
|---|---|---|
| 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 | */ | |
| 25 | 80 | public class BipartiteVertex extends SparseVertex { |
| 26 | ||
| 27 | /** | |
| 28 | * Specialized copy function for copy FROM BipartiteGraph TO BipartiteGraph | |
| 29 | */ | |
| 30 | public ArchetypeVertex copy(ArchetypeGraph newGraph) { | |
| 31 | 17 | if (!(newGraph instanceof BipartiteGraph |
| 32 | && this.getGraph() instanceof BipartiteGraph)) { | |
| 33 | 3 | return super.copy(newGraph); |
| 34 | } | |
| 35 | 14 | BipartiteGraph bpg = (BipartiteGraph) newGraph; |
| 36 | ||
| 37 | 14 | if (newGraph == this.getGraph()) |
| 38 | 0 | throw new IllegalArgumentException( |
| 39 | "Source and destination graphs " + "must be different"); | |
| 40 | ||
| 41 | try { | |
| 42 | 14 | BipartiteVertex v = (BipartiteVertex) clone(); |
| 43 | 14 | v.initialize(); |
| 44 | 14 | v.importUserData(this); |
| 45 | 14 | BipartiteGraph thisGraph = (BipartiteGraph) this.getGraph(); |
| 46 | 14 | bpg.addVertex(v, thisGraph.getPartition(this)); |
| 47 | 14 | return v; |
| 48 | 0 | } catch (CloneNotSupportedException cne) { |
| 49 | 0 | throw new FatalException("Can't copy vertex ", cne); |
| 50 | } | |
| 51 | } | |
| 52 | ||
| 53 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |