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