]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/scratch/org/simantics/databoard/tests/Jotakin3.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / scratch / org / simantics / databoard / tests / Jotakin3.java
1 /*******************************************************************************\r
2  * Copyright (c) 2010- Association for Decentralized Information Management in\r
3  * Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  * \r
9  * Contributors:\r
10  *    VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.databoard.tests;\r
13 \r
14 import org.simantics.databoard.accessor.reference.ChildReference;\r
15 import org.simantics.databoard.accessor.reference.ComponentReference;\r
16 import org.simantics.databoard.accessor.reference.KeyReference;\r
17 import org.simantics.databoard.accessor.reference.LabelReference;\r
18 import org.simantics.databoard.accessor.reference.NameReference;\r
19 import org.simantics.databoard.binding.mutable.MutableVariant;\r
20 \r
21 public class Jotakin3 {\r
22 \r
23         public static void main(String[] args) {\r
24                 \r
25                 ChildReference ref1 = ChildReference.compile(\r
26                                 new NameReference("nodes"),\r
27                                 new KeyReference( MutableVariant.ofInstance("SINE") ),\r
28                                 new NameReference("value"),\r
29                                 new ComponentReference(),\r
30                                 new ComponentReference()\r
31                                 ); \r
32 \r
33                 ChildReference ref4 = ChildReference.compile(\r
34                                 new LabelReference("nodes"),\r
35                                 new LabelReference("SSINE"),\r
36                                 new LabelReference("value"),\r
37                                 new LabelReference("o"),\r
38                                 new LabelReference("v")\r
39                                 ); \r
40                 \r
41                 System.out.println(ref1.toPath(true));  \r
42                 System.out.println(ref1.toPath(false)); \r
43                 \r
44                 ChildReference ref2 = ChildReference.parsePath("n-nodes/m-SSINE/n-value/o/v");\r
45                 System.out.println(ref2.toPath(true));  \r
46                 System.out.println(ref2.toPath(false)); \r
47                 \r
48                 ChildReference ref3 = ChildReference.parsePath("nodes/SSINE/value/o/v");\r
49                 System.out.println(ref3.toPath(true));  \r
50                 System.out.println(ref3.toPath(false));\r
51                 \r
52                 System.out.println( ref1.equals( ref2 ) );\r
53                 System.out.println( ref2.equals( ref1 ) );\r
54                 \r
55                 System.out.println( ref1.equals( ref3 ) );\r
56                 System.out.println( ref3.equals( ref1 ) );\r
57 \r
58                 System.out.println( ref3.equals( ref4 ) );\r
59                 System.out.println( ref4.equals( ref3 ) );\r
60 \r
61         }\r
62         \r
63 }\r
64 \r