/******************************************************************************* * Copyright (c) 2007, 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 *******************************************************************************/ /* * 18.8.2006 */ package org.simantics.utils.datastructures; import java.util.Arrays; /** * Deep comparable array object. * * @author Toni Kalajainen */ public final class Array { private final T[] array; private final int hashCode; public Array(T[] array) { this.array = array.clone(); this.hashCode = makeHashCode(this.array); } private static int makeHashCode(T[] array) { int hash = 1; for (int i=0; i)obj).array); } public int size() { return array.length; } }