X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fexamples%2Forg%2Fsimantics%2Fdataboard%2Fexample%2FDeepHashcode.java;fp=bundles%2Forg.simantics.databoard%2Fexamples%2Forg%2Fsimantics%2Fdataboard%2Fexample%2FDeepHashcode.java;h=b8ac4ee62d46664d4c0901daf742a39f51839984;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=f7b75447062270bac313fe696073713e5bdf96c9;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/DeepHashcode.java b/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/DeepHashcode.java index f7b754470..b8ac4ee62 100644 --- a/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/DeepHashcode.java +++ b/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/DeepHashcode.java @@ -1,35 +1,35 @@ -/******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management in - * Industry THTH ry. - * 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.databoard.example; - -import org.simantics.databoard.Bindings; -import org.simantics.databoard.binding.Binding; -import org.simantics.databoard.binding.error.BindingException; - -public class DeepHashcode { - - public static void main(String[] args) throws BindingException { - - // Binding can calculate deep hashcode for any instance - Binding binding = Bindings.getBindingUnchecked( int[].class ); - - int[] array1 = new int[] { 1, 2, 3 }; - int[] array2 = new int[] { 1, 2, 3 }; - int[] array3 = new int[] { 2, 3, 4 }; - - System.out.println( "Hashcode for array1 is " + binding.hashValue( array1 ) ); - System.out.println( "Hashcode for array2 is " + binding.hashValue( array2 ) ); - System.out.println( "Hashcode for array3 is " + binding.hashValue( array3 ) ); - - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * 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.databoard.example; + +import org.simantics.databoard.Bindings; +import org.simantics.databoard.binding.Binding; +import org.simantics.databoard.binding.error.BindingException; + +public class DeepHashcode { + + public static void main(String[] args) throws BindingException { + + // Binding can calculate deep hashcode for any instance + Binding binding = Bindings.getBindingUnchecked( int[].class ); + + int[] array1 = new int[] { 1, 2, 3 }; + int[] array2 = new int[] { 1, 2, 3 }; + int[] array3 = new int[] { 2, 3, 4 }; + + System.out.println( "Hashcode for array1 is " + binding.hashValue( array1 ) ); + System.out.println( "Hashcode for array2 is " + binding.hashValue( array2 ) ); + System.out.println( "Hashcode for array3 is " + binding.hashValue( array3 ) ); + + } + +}