X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Faccessor%2Freference%2FIndexReference.java;h=d3f1d7bd53849359210522c4fee904d991877c30;hb=39508c529ed6dce08d4ca505c9518e3e82fd6efa;hp=4b8cfdffc0f2102eb0a0c399d7b3d05d0d38130a;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/reference/IndexReference.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/reference/IndexReference.java index 4b8cfdffc..d3f1d7bd5 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/reference/IndexReference.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/reference/IndexReference.java @@ -1,14 +1,14 @@ -/******************************************************************************* - * 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 - *******************************************************************************/ +/******************************************************************************* + * 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.accessor.reference; @@ -26,12 +26,12 @@ public class IndexReference extends ChildReference { super(child); this.index = index; } - - @Override - public String toString(boolean labelReference) { - return labelReference ? ""+index : "i-"+index; - } - + + @Override + public String toString(boolean labelReference) { + return labelReference ? ""+index : "i-"+index; + } + public int getIndex() { return index; } @@ -43,24 +43,24 @@ public class IndexReference extends ChildReference { @Override public ChildReference clone() { return new IndexReference(index, childReference==null ? null : childReference.clone()); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof IndexReference == false) return false; - IndexReference other = (IndexReference) obj; - if (other.index != index) return false; - if (other.hasChildReference() != hasChildReference()) return false; - if (hasChildReference() && !other.childReference.equals(childReference)) return false; - return true; - } - - @Override - public int hashCode() { - int hash = 423423 + 37 * index; - if (hasChildReference()) hash = 31*hash + childReference.hashCode(); - return hash; - } - + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof IndexReference == false) return false; + IndexReference other = (IndexReference) obj; + if (other.index != index) return false; + if (other.hasChildReference() != hasChildReference()) return false; + if (hasChildReference() && !other.childReference.equals(childReference)) return false; + return true; + } + + @Override + public int hashCode() { + int hash = 423423 + 37 * index; + if (hasChildReference()) hash = 31*hash + childReference.hashCode(); + return hash; + } + }