-/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.modeling.subscription;\r
-\r
-import org.simantics.databoard.annotations.Identifier;\r
-import org.simantics.databoard.annotations.Optional;\r
-import org.simantics.databoard.util.Bean;\r
-import org.simantics.utils.strings.AlphanumComparator;\r
-\r
-/**\r
- * @author Antti Villberg\r
- */\r
-public class SubscriptionItem extends Bean {\r
- \r
- // Normal Label (eg. The label in CSV file)\r
- public @Optional String simpleLabel;\r
- // Variable reference in user friendly format\r
- public @Optional String variableReference;\r
- \r
- // GroupId in the history\r
- public @Identifier String groupId;\r
- // ItemId in the group\r
- public @Identifier String groupItemId;\r
- // Variable id in format understood by org.simantics.simulation.data.Datasource\r
- public @Identifier String variableId;\r
- \r
- public @Optional String unit;\r
- \r
- public SubscriptionItem() {\r
- }\r
- \r
- @Override\r
- public int compareTo(Bean o) {\r
- if ( o instanceof SubscriptionItem == false ) return 0;\r
- SubscriptionItem other = (SubscriptionItem) o;\r
- \r
- String myLabel2 = simpleLabel!=null?simpleLabel:"";\r
- String otLabel2 = other.simpleLabel!=null?other.simpleLabel:"";\r
- int c = AlphanumComparator.CASE_INSENSITIVE_COMPARATOR.compare(myLabel2, otLabel2);\r
- if ( c!=0 ) return c;\r
- \r
- String mySid = groupId!=null?groupId:""; \r
- String otSid = other.groupId!=null?other.groupId:""; \r
- c = mySid.compareTo(otSid);\r
- if ( c!=0 ) return c;\r
-\r
- String myGiid = groupItemId!=null?groupItemId:""; \r
- String otGiid = other.groupItemId!=null?other.groupItemId:""; \r
- c = myGiid.compareTo(otGiid);\r
- if ( c!=0 ) return c;\r
-\r
- String myVid = variableId!=null?variableId:""; \r
- String otVid = other.variableId!=null?other.variableId:""; \r
- c = myVid.compareTo(otVid);\r
- if ( c!=0 ) return c;\r
- \r
- return c; \r
- }\r
- \r
-}\r
-\r
+/*******************************************************************************
+ * Copyright (c) 2007 VTT Technical Research Centre of Finland 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:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.modeling.subscription;
+
+import org.simantics.databoard.annotations.Identifier;
+import org.simantics.databoard.annotations.Optional;
+import org.simantics.databoard.util.Bean;
+import org.simantics.utils.strings.AlphanumComparator;
+
+/**
+ * @author Antti Villberg
+ */
+public class SubscriptionItem extends Bean {
+
+ // Normal Label (eg. The label in CSV file)
+ public @Optional String simpleLabel;
+ // Variable reference in user friendly format
+ public @Optional String variableReference;
+
+ // GroupId in the history
+ public @Identifier String groupId;
+ // ItemId in the group
+ public @Identifier String groupItemId;
+ // Variable id in format understood by org.simantics.simulation.data.Datasource
+ public @Identifier String variableId;
+
+ public @Optional String unit;
+
+ public SubscriptionItem() {
+ }
+
+ @Override
+ public int compareTo(Bean o) {
+ if ( o instanceof SubscriptionItem == false ) return 0;
+ SubscriptionItem other = (SubscriptionItem) o;
+
+ String myLabel2 = simpleLabel!=null?simpleLabel:"";
+ String otLabel2 = other.simpleLabel!=null?other.simpleLabel:"";
+ int c = AlphanumComparator.CASE_INSENSITIVE_COMPARATOR.compare(myLabel2, otLabel2);
+ if ( c!=0 ) return c;
+
+ String mySid = groupId!=null?groupId:"";
+ String otSid = other.groupId!=null?other.groupId:"";
+ c = mySid.compareTo(otSid);
+ if ( c!=0 ) return c;
+
+ String myGiid = groupItemId!=null?groupItemId:"";
+ String otGiid = other.groupItemId!=null?other.groupItemId:"";
+ c = myGiid.compareTo(otGiid);
+ if ( c!=0 ) return c;
+
+ String myVid = variableId!=null?variableId:"";
+ String otVid = other.variableId!=null?other.variableId:"";
+ c = myVid.compareTo(otVid);
+ if ( c!=0 ) return c;
+
+ return c;
+ }
+
+}
+