summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/DataKeyID.java
diff options
context:
space:
mode:
Diffstat (limited to 'projects/net.wotonomy.test/src/main/java/net/wotonomy/test/DataKeyID.java')
-rw-r--r--projects/net.wotonomy.test/src/main/java/net/wotonomy/test/DataKeyID.java88
1 files changed, 88 insertions, 0 deletions
diff --git a/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/DataKeyID.java b/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/DataKeyID.java
new file mode 100644
index 0000000..fca6c98
--- /dev/null
+++ b/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/DataKeyID.java
@@ -0,0 +1,88 @@
+package net.wotonomy.test;
+
+import net.wotonomy.control.EOGlobalID;
+import net.wotonomy.datastore.DataKey;
+
+/**
+* A test implementation of EOGlobalID that
+* wraps a DataKey.
+*
+* @author michael@mpowers.net
+* @author $Author: cgruber $
+* @version $Revision: 893 $
+*/
+public class DataKeyID extends EOGlobalID
+{
+ private DataKey key;
+
+ /**
+ * Constructor takes a data key.
+ */
+ public DataKeyID( DataKey aKey )
+ {
+ key = aKey;
+ }
+
+ /**
+ * Returns the wrapped data key.
+ */
+ public DataKey getKey()
+ {
+ return key;
+ }
+
+ public boolean isTemporary()
+ {
+ return false;
+ }
+
+ public Object clone()
+ {
+ return new DataKeyID( (DataKey) key.clone() );
+ }
+
+ public String toString()
+ {
+ return "[DataKeyID:"+key.toString()+"]";
+ }
+
+ public int hashCode()
+ {
+ return key.hashCode();
+ }
+
+ public boolean equals( Object anObject )
+ {
+ if ( anObject instanceof DataKeyID )
+ {
+ if ( ((DataKeyID)anObject).key.equals( key ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
+
+/*
+ * $Log$
+ * Revision 1.1 2006/02/16 13:22:22 cgruber
+ * Check in all sources in eclipse-friendly maven-enabled packages.
+ *
+ * Revision 1.3 2001/02/23 23:44:44 mpowers
+ * Fixes for hashcode to ensure proper key comparison.
+ *
+ * Revision 1.2 2001/02/22 20:56:07 mpowers
+ * Tests of notification handling.
+ *
+ * Revision 1.1 2001/02/15 21:14:45 mpowers
+ * Test suite now using a persistent object store with editing context.
+ *
+ * Revision 1.1 2001/02/05 03:45:37 mpowers
+ * Starting work on EOEditingContext.
+ *
+ *
+ */
+
+