X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Ffeatures%2Fregistry%2FGroupReference.java;h=6deb4af40170b50be92d905fbbb564e3212dcc27;hb=6d789e04560b01a1845d39f7e951230bb74d6470;hp=39dd7edd9368e7a3325fdfd9d052ad4df48dbcb8;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.project/src/org/simantics/project/features/registry/GroupReference.java b/bundles/org.simantics.project/src/org/simantics/project/features/registry/GroupReference.java index 39dd7edd9..6deb4af40 100644 --- a/bundles/org.simantics.project/src/org/simantics/project/features/registry/GroupReference.java +++ b/bundles/org.simantics.project/src/org/simantics/project/features/registry/GroupReference.java @@ -1,186 +1,186 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.project.features.registry; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -/** - * A reference to a P2 feature group installable unit (IU). - * - *
- * Contains an ID and an optional version specifier. If a version is not
- * specified, it is null
. The version can be either a single
- * version or a version range.
- *
- *
- * Serializes to the format
+ * Contains an ID and an optional version specifier. If a version is not
+ * specified, it is
+ * Serializes to the format ID/version
- *
- * @author Tuukka Lehtonen
- */
-public class GroupReference implements Comparabletrue
if id's are equal
- */
- public boolean idEquals(GroupReference other) {
- return id.equals(other.id);
- }
-
- /**
- * Checks whether this feature reference fulfills the demand imposed by the
- * specified feature reference. Fulfillment implies matching feature ID and
- * a version match or a version range for this feature reference that includes the
- * absolute version in the specified feature reference.
- *
- * @param ref
- * @return
- */
- public boolean includes(GroupReference request) {
- if (!id.equals(request.id))
- return false;
-
- if (version == null)
- // Any version will do.
- return true;
-
- // TODO: implement version checking
-
- // ASSERT: request.version is an absolute version, not a range
-
- // If this.version is a absolute version, check that request.version is
- // greater or equal than this.version.
-
- // If this.version is a version range, check that the range includes
- // request.version.
-
- return true;
- }
-
- @Override
- public int compareTo(GroupReference o) {
- int idDelta = id.compareTo(o.id);
- if (idDelta != 0)
- return idDelta;
-
- // TODO: comparability based on version comparability
-
- return 0;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * 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:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.project.features.registry;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A reference to a P2 feature group installable unit (IU).
+ *
+ * null
. The version can be either a single
+ * version or a version range.
+ *
+ * ID/version
+ *
+ * @author Tuukka Lehtonen
+ */
+public class GroupReference implements Comparabletrue
if id's are equal
+ */
+ public boolean idEquals(GroupReference other) {
+ return id.equals(other.id);
+ }
+
+ /**
+ * Checks whether this feature reference fulfills the demand imposed by the
+ * specified feature reference. Fulfillment implies matching feature ID and
+ * a version match or a version range for this feature reference that includes the
+ * absolute version in the specified feature reference.
+ *
+ * @param ref
+ * @return
+ */
+ public boolean includes(GroupReference request) {
+ if (!id.equals(request.id))
+ return false;
+
+ if (version == null)
+ // Any version will do.
+ return true;
+
+ // TODO: implement version checking
+
+ // ASSERT: request.version is an absolute version, not a range
+
+ // If this.version is a absolute version, check that request.version is
+ // greater or equal than this.version.
+
+ // If this.version is a version range, check that the range includes
+ // request.version.
+
+ return true;
+ }
+
+ @Override
+ public int compareTo(GroupReference o) {
+ int idDelta = id.compareTo(o.id);
+ if (idDelta != 0)
+ return idDelta;
+
+ // TODO: comparability based on version comparability
+
+ return 0;
+ }
+
+}