Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-02-23 17:32:35 -0500
committerslewis2009-02-23 17:32:35 -0500
commit0b177a407e4afc67af9ba6d8a2f6bc2ae56bb138 (patch)
tree5645622c1aa7e7461cee6ffea687b05fa332b1d3 /framework/bundles/org.eclipse.ecf.identity/src
parentad9b2435eb2dca079ebfc6bdf1415f21886219c3 (diff)
downloadorg.eclipse.ecf-0b177a407e4afc67af9ba6d8a2f6bc2ae56bb138.tar.gz
org.eclipse.ecf-0b177a407e4afc67af9ba6d8a2f6bc2ae56bb138.tar.xz
org.eclipse.ecf-0b177a407e4afc67af9ba6d8a2f6bc2ae56bb138.zip
Added URIID for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=250717v20090223-2200
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/URIID.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/URIID.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/URIID.java
new file mode 100644
index 000000000..2b3b3ff59
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/URIID.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2009 EclipseSource and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * EclipseSource - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.identity;
+
+import java.net.URI;
+import org.eclipse.core.runtime.Assert;
+
+/**
+ * URI ID class.
+ *
+ * @since 3.0
+ */
+public class URIID extends BaseID implements IResourceID {
+
+ private static final long serialVersionUID = 7328962407044918278L;
+ private final URI uri;
+
+ public URIID(Namespace namespace, URI uri) {
+ super(namespace);
+ Assert.isNotNull(uri);
+ this.uri = uri;
+ }
+
+ protected int namespaceCompareTo(BaseID o) {
+ if (this == o)
+ return 0;
+ if (!this.getClass().equals(o.getClass()))
+ return Integer.MIN_VALUE;
+ return this.uri.compareTo(((URIID) o).uri);
+ }
+
+ protected boolean namespaceEquals(BaseID o) {
+ if (this == o)
+ return true;
+ if (!this.getClass().equals(o.getClass()))
+ return false;
+ return this.uri.equals(((URIID) o).uri);
+ }
+
+ protected String namespaceGetName() {
+ return uri.toString();
+ }
+
+ protected int namespaceHashCode() {
+ return uri.hashCode();
+ }
+
+ public URI toURI() {
+ return uri;
+ }
+
+}

Back to the top