001: /*******************************************************************************
002: * Copyright (c) 2000, 2007 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.debug.core;
011:
012: import org.eclipse.debug.core.DebugException;
013: import org.eclipse.debug.core.model.IIndexedValue;
014:
015: /**
016: * A value referencing an array on a target VM.
017: * <p>
018: * Clients are not intended to implement this interface.
019: * </p>
020: * @see IJavaValue
021: * @since 2.0
022: */
023:
024: public interface IJavaArray extends IJavaObject, IIndexedValue {
025:
026: /**
027: * Returns the values contained in this array.
028: *
029: * @return the values contained in this array
030: * @exception DebugException if this method fails. Reasons include:<ul>
031: * <li>Failure communicating with the VM. The DebugException's
032: * status code contains the underlying exception responsible for
033: * the failure.</li>
034: * </ul>
035: */
036: public IJavaValue[] getValues() throws DebugException;
037:
038: /**
039: * Returns the value at the given index in
040: * this array.
041: *
042: * @param index the index of the value to return
043: * @return the value at the given index
044: * @exception DebugException if this method fails. Reasons include:<ul>
045: * <li>Failure communicating with the VM. The DebugException's
046: * status code contains the underlying exception responsible for
047: * the failure.</li>
048: * </ul>
049: * @exception java.lang.IndexOutOfBoundsException if the index is
050: * not within the bounds of this array.
051: */
052: public IJavaValue getValue(int index) throws DebugException;
053:
054: /**
055: * Returns the length of this array.
056: *
057: * @return the length of this array
058: * @exception DebugException if this method fails. Reasons include:<ul>
059: * <li>Failure communicating with the VM. The DebugException's
060: * status code contains the underlying exception responsible for
061: * the failure.</li>
062: * </ul
063: */
064: public int getLength() throws DebugException;
065:
066: /**
067: * Sets the value at the given index to the specified
068: * value.
069: *
070: * @param index the index at which to assign a new value
071: * @param value the new value
072: * @exception DebugException if this method fails. Reasons include:<ul>
073: * <li>Failure communicating with the VM. The DebugException's
074: * status code contains the underlying exception responsible for
075: * the failure.</li>
076: * <li>The given value is not compatible with the type of this
077: * array</li>
078: * </ul>
079: * @exception java.lang.IndexOutOfBoundsException if the index is
080: * not within the bounds of this array.
081: */
082: public void setValue(int index, IJavaValue value)
083: throws DebugException;
084:
085: /**
086: * Replaces values in this array. If the given replacement values length is less
087: * that the length of this array, only the number of values in the given array
088: * are replaced. If the given replacement values length is longer than the length of
089: * this array, values in positions greater than the length of this array are ignored.
090: *
091: * @param values replacement values
092: * @exception DebugException if an exception occurs replacing values
093: * @since 3.4
094: */
095: public void setValues(IJavaValue[] values) throws DebugException;
096:
097: /**
098: * Replaces a range of values in this array.
099: *
100: * @param offset offset in this array to start replacing values at
101: * @param length the number of values to replace in this array
102: * @param values replacement values
103: * @param startOffset the first offset where values are copied from the
104: * given replacement values
105: * @exception DebugException if an exception occurs replacing values or if the given
106: * offsets and length are not within the range of this array or the replacement
107: * values
108: * @since 3.4
109: */
110: public void setValues(int offset, int length, IJavaValue[] values,
111: int startOffset) throws DebugException;
112:
113: }
|