| Line | Hits | Source |
|---|---|---|
| 1 | /* | |
| 2 | * Created on Jul 30, 2005 | |
| 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.Iterator; | |
| 15 | ||
| 16 | ||
| 17 | public class UserDataDelegate implements UserDataContainer, Cloneable | |
| 18 | { | |
| 19 | protected UserDataContainer udc_delegate; | |
| 20 | 74 | protected static UserDataFactory factory = (UserDataFactory)new DefaultUserData(); |
| 21 | // protected static UserDataFactory factory = (UserDataFactory)new UnifiedUserData(); | |
| 22 | ||
| 23 | public UserDataDelegate() | |
| 24 | 179392 | { |
| 25 | 179392 | this.udc_delegate = factory.getInstance(); |
| 26 | 179392 | } |
| 27 | ||
| 28 | public static void setUserDataFactory(UserDataFactory udf) | |
| 29 | { | |
| 30 | 0 | factory = udf; |
| 31 | 0 | } |
| 32 | ||
| 33 | public Object clone() throws CloneNotSupportedException | |
| 34 | { | |
| 35 | 1761 | UserDataDelegate udd = (UserDataDelegate)super.clone(); |
| 36 | 1761 | udd.udc_delegate = (UserDataContainer)udc_delegate.clone(); |
| 37 | 1761 | return udd; |
| 38 | } | |
| 39 | ||
| 40 | public void addUserDatum(Object key, Object datum, CopyAction copyAct) | |
| 41 | { | |
| 42 | 8188 | udc_delegate.addUserDatum(key, datum, copyAct); |
| 43 | 8188 | } |
| 44 | ||
| 45 | public void importUserData(UserDataContainer udc) | |
| 46 | { | |
| 47 | 1766 | udc_delegate.importUserData(udc); |
| 48 | 1766 | } |
| 49 | ||
| 50 | public Iterator getUserDatumKeyIterator() | |
| 51 | { | |
| 52 | 1773 | return udc_delegate.getUserDatumKeyIterator(); |
| 53 | } | |
| 54 | ||
| 55 | public CopyAction getUserDatumCopyAction(Object key) | |
| 56 | { | |
| 57 | 536 | return udc_delegate.getUserDatumCopyAction(key); |
| 58 | } | |
| 59 | ||
| 60 | public Object getUserDatum(Object key) | |
| 61 | { | |
| 62 | 1850631 | return udc_delegate.getUserDatum(key); |
| 63 | } | |
| 64 | ||
| 65 | public void setUserDatum(Object key, Object datum, CopyAction copyAct) | |
| 66 | { | |
| 67 | 22746 | udc_delegate.setUserDatum(key, datum, copyAct); |
| 68 | 22746 | } |
| 69 | ||
| 70 | public Object removeUserDatum(Object key) | |
| 71 | { | |
| 72 | 21344 | return udc_delegate.removeUserDatum(key); |
| 73 | } | |
| 74 | ||
| 75 | public boolean containsUserDatumKey(Object key) | |
| 76 | { | |
| 77 | 8 | return udc_delegate.containsUserDatumKey(key); |
| 78 | } | |
| 79 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |