Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java')
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java71
1 files changed, 0 insertions, 71 deletions
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java
deleted file mode 100644
index 94422237f..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jem.internal.proxy.vm.remote;
-/*
- * $RCSfile: ArrayHelper.java,v $
- * $Revision: 1.3 $ $Date: 2005/08/24 20:39:08 $
- */
-
-
-/**
- * This class provides similiar function as the java.lang.reflect.Array class but
- * it handles multi-dimensional arrays. Without this helper, the client would have
- * to walk down through each dimension executing a get command. This would mean
- * many transactions instead of one provided by this helper.
- *
- * It also provides some other helper functions for arrays that Array doesn't provide.
- */
-
-public final class ArrayHelper {
- // It can never be instantiated.
- private ArrayHelper() {
- }
-
- public static Object get(Object array, int[] indexes) {
- Object answer = array;
- for (int i=0; i<indexes.length; i++)
- answer = java.lang.reflect.Array.get(answer, indexes[i]);
- return answer;
- }
-
- public static byte getByte(Object array, int[] indexes) {
- return ((Byte) get(array, indexes)).byteValue();
- }
- public static boolean getBoolean(Object array, int[] indexes) {
- return ((Boolean) get(array, indexes)).booleanValue();
- }
- public static char getChar(Object array, int[] indexes) {
- return ((Character) get(array, indexes)).charValue();
- }
- public static double getDouble(Object array, int[] indexes) {
- return ((Double) get(array, indexes)).doubleValue();
- }
- public static float getFloat(Object array, int[] indexes) {
- return ((Float) get(array, indexes)).floatValue();
- }
- public static int getInt(Object array, int[] indexes) {
- return ((Integer) get(array, indexes)).intValue();
- }
- public static long getLong(Object array, int[] indexes) {
- return ((Long) get(array, indexes)).longValue();
- }
- public static short getShort(Object array, int[] indexes) {
- return ((Short) get(array, indexes)).shortValue();
- }
-
- public static void set(Object array, int[] indexes, Object value) {
- Object subArray = array;
- int upTo = indexes.length-1;
- for (int i=0; i<upTo; i++)
- subArray = java.lang.reflect.Array.get(subArray, indexes[i]);
- java.lang.reflect.Array.set(subArray, indexes[upTo], value);
- }
-}

Back to the top