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