1 /*******************************************************************************
\r
2 * Copyright (c) 2010- Association for Decentralized Information Management in
\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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.databoard.tests;
\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
21 public class Jotakin3 {
\r
23 public static void main(String[] args) {
\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
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
41 System.out.println(ref1.toPath(true));
\r
42 System.out.println(ref1.toPath(false));
\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
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
52 System.out.println( ref1.equals( ref2 ) );
\r
53 System.out.println( ref2.equals( ref1 ) );
\r
55 System.out.println( ref1.equals( ref3 ) );
\r
56 System.out.println( ref3.equals( ref1 ) );
\r
58 System.out.println( ref3.equals( ref4 ) );
\r
59 System.out.println( ref4.equals( ref3 ) );
\r