| Line | Hits | Source |
|---|---|---|
| 1 | /* | |
| 2 | * Created on Nov 7, 2004 | |
| 3 | * | |
| 4 | * Copyright (c) 2004, the JUNG Project and the Regents of the University | |
| 5 | * of California | |
| 6 | * All rights reserved. | |
| 7 | * | |
| 8 | * This software is open-source under the BSD license; see either | |
| 9 | * "license.txt" or | |
| 10 | * http://jung.sourceforge.net/license.txt for a description. | |
| 11 | */ | |
| 12 | package edu.uci.ics.jung.utils; | |
| 13 | ||
| 14 | import java.util.HashMap; | |
| 15 | import java.util.Map; | |
| 16 | ||
| 17 | import edu.uci.ics.jung.graph.ArchetypeVertex; | |
| 18 | ||
| 19 | /** | |
| 20 | * Uses a <code>HashMap</code> to store mappings between vertices. | |
| 21 | * Places no constraints on mappings (mappings need not be 1-1, | |
| 22 | * onto, etc.). | |
| 23 | * | |
| 24 | * @author Joshua O'Madadhain | |
| 25 | */ | |
| 26 | public class HashSettableVertexMapper implements SettableVertexMapper | |
| 27 | { | |
| 28 | protected Map m; | |
| 29 | ||
| 30 | public HashSettableVertexMapper() | |
| 31 | 0 | { |
| 32 | 0 | m = new HashMap(); |
| 33 | 0 | } |
| 34 | ||
| 35 | /** | |
| 36 | * @see edu.uci.ics.jung.utils.SettableVertexMapper#map(edu.uci.ics.jung.graph.ArchetypeVertex, edu.uci.ics.jung.graph.ArchetypeVertex) | |
| 37 | */ | |
| 38 | public void map(ArchetypeVertex v1, ArchetypeVertex v2) | |
| 39 | { | |
| 40 | 0 | m.put(v1, v2); |
| 41 | 0 | } |
| 42 | ||
| 43 | /** | |
| 44 | * @see edu.uci.ics.jung.utils.VertexMapper#getMappedVertex(edu.uci.ics.jung.graph.ArchetypeVertex) | |
| 45 | */ | |
| 46 | public ArchetypeVertex getMappedVertex(ArchetypeVertex v) | |
| 47 | { | |
| 48 | 0 | return (ArchetypeVertex)m.get(v); |
| 49 | } | |
| 50 | ||
| 51 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |