X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fbinding%2Freflection%2FClassBinding.java;h=0505396d90de67466d1f6d9981c730a00a4c5e8a;hb=95bce3521a3c97f463c3d533a36a606c7ae6f0aa;hp=cfb21df4b9f2edb8bca920fb8221262211d6c0c3;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/reflection/ClassBinding.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/reflection/ClassBinding.java index cfb21df4b..0505396d9 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/reflection/ClassBinding.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/reflection/ClassBinding.java @@ -1,60 +1,60 @@ -/******************************************************************************* - * Copyright (c) 2010 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.binding.reflection; - -import org.simantics.databoard.binding.RecordBinding; -import org.simantics.databoard.binding.error.BindingConstructionException; - -/** - * RecordBinding that represents a class - */ -public abstract class ClassBinding extends RecordBinding { - - public final ClassInfo ci; - - /** - * Create binding for a class. - * - * @param ci - * @throws BindingConstructionException - */ - public ClassBinding(ClassInfo ci) - { - this.ci = ci; - } - - /** - * Create binding for a class. - * - * @param clazz - * @throws BindingConstructionException - */ - public ClassBinding(Class clazz) throws BindingConstructionException - { - this( ClassInfo.getInfo(clazz) ); - } - - public Class getClazz() - { - return ci.clazz; - } - - @Override - protected boolean baseEquals(Object obj) { - return super.baseEquals(obj) && ((ClassBinding)obj).ci.equals(ci); - } - - @Override - public int baseHashCode() { - return super.baseHashCode() + 17 * ci.hashCode(); - } -} +/******************************************************************************* + * Copyright (c) 2010 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.binding.reflection; + +import org.simantics.databoard.binding.RecordBinding; +import org.simantics.databoard.binding.error.BindingConstructionException; + +/** + * RecordBinding that represents a class + */ +public abstract class ClassBinding extends RecordBinding { + + public final ClassInfo ci; + + /** + * Create binding for a class. + * + * @param ci + * @throws BindingConstructionException + */ + public ClassBinding(ClassInfo ci) + { + this.ci = ci; + } + + /** + * Create binding for a class. + * + * @param clazz + * @throws BindingConstructionException + */ + public ClassBinding(Class clazz) throws BindingConstructionException + { + this( ClassInfo.getInfo(clazz) ); + } + + public Class getClazz() + { + return ci.clazz; + } + + @Override + protected boolean baseEquals(Object obj) { + return super.baseEquals(obj) && ((ClassBinding)obj).ci.equals(ci); + } + + @Override + public int baseHashCode() { + return super.baseHashCode() + 17 * ci.hashCode(); + } +}