| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
| DataKeyID |
|
| 1.4285714285714286;1.429 |
| 1 | package net.wotonomy.test; |
|
| 2 | ||
| 3 | import net.wotonomy.control.EOGlobalID; |
|
| 4 | import net.wotonomy.datastore.DataKey; |
|
| 5 | ||
| 6 | /** |
|
| 7 | * A test implementation of EOGlobalID that |
|
| 8 | * wraps a DataKey. |
|
| 9 | * |
|
| 10 | * @author michael@mpowers.net |
|
| 11 | * @author $Author: cgruber $ |
|
| 12 | * @version $Revision: 893 $ |
|
| 13 | */ |
|
| 14 | public class DataKeyID extends EOGlobalID |
|
| 15 | { |
|
| 16 | private DataKey key; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Constructor takes a data key. |
|
| 20 | */ |
|
| 21 | 0 | public DataKeyID( DataKey aKey ) |
| 22 | 0 | { |
| 23 | 0 | key = aKey; |
| 24 | 0 | } |
| 25 | ||
| 26 | /** |
|
| 27 | * Returns the wrapped data key. |
|
| 28 | */ |
|
| 29 | public DataKey getKey() |
|
| 30 | { |
|
| 31 | 0 | return key; |
| 32 | } |
|
| 33 | ||
| 34 | public boolean isTemporary() |
|
| 35 | { |
|
| 36 | 0 | return false; |
| 37 | } |
|
| 38 | ||
| 39 | public Object clone() |
|
| 40 | { |
|
| 41 | 0 | return new DataKeyID( (DataKey) key.clone() ); |
| 42 | } |
|
| 43 | ||
| 44 | public String toString() |
|
| 45 | { |
|
| 46 | 0 | return "[DataKeyID:"+key.toString()+"]"; |
| 47 | } |
|
| 48 | ||
| 49 | public int hashCode() |
|
| 50 | { |
|
| 51 | 0 | return key.hashCode(); |
| 52 | } |
|
| 53 | ||
| 54 | public boolean equals( Object anObject ) |
|
| 55 | { |
|
| 56 | 0 | if ( anObject instanceof DataKeyID ) |
| 57 | { |
|
| 58 | 0 | if ( ((DataKeyID)anObject).key.equals( key ) ) |
| 59 | { |
|
| 60 | 0 | return true; |
| 61 | } |
|
| 62 | } |
|
| 63 | 0 | return false; |
| 64 | } |
|
| 65 | ||
| 66 | } |
|
| 67 | ||
| 68 | /* |
|
| 69 | * $Log$ |
|
| 70 | * Revision 1.1 2006/02/16 13:22:22 cgruber |
|
| 71 | * Check in all sources in eclipse-friendly maven-enabled packages. |
|
| 72 | * |
|
| 73 | * Revision 1.3 2001/02/23 23:44:44 mpowers |
|
| 74 | * Fixes for hashcode to ensure proper key comparison. |
|
| 75 | * |
|
| 76 | * Revision 1.2 2001/02/22 20:56:07 mpowers |
|
| 77 | * Tests of notification handling. |
|
| 78 | * |
|
| 79 | * Revision 1.1 2001/02/15 21:14:45 mpowers |
|
| 80 | * Test suite now using a persistent object store with editing context. |
|
| 81 | * |
|
| 82 | * Revision 1.1 2001/02/05 03:45:37 mpowers |
|
| 83 | * Starting work on EOEditingContext. |
|
| 84 | * |
|
| 85 | * |
|
| 86 | */ |
|
| 87 | ||
| 88 |