public class

ArrayReferenceImpl

extends ObjectReferenceImpl
implements ArrayReference
java.lang.Object
   ↳ com.sun.tools.jdi.ObjectReferenceImpl
     ↳ com.sun.tools.jdi.ArrayReferenceImpl

Summary

[Expand]
Inherited Constants
From interface com.sun.jdi.ObjectReference
[Expand]
Inherited Fields
From class com.sun.tools.jdi.ObjectReferenceImpl
Public Methods
Value getValue(int index)
Returns an array component value.
List<Value> getValues(int index, int length)
Returns a range of array components.
List<Value> getValues()
Returns all of the components in this array.
int length()
Return array length.
void setValue(int index, Value value)
Replaces an array component with another value.
void setValues(int index, List<? extends Value> values, int srcIndex, int length)
Replaces a range of array components with other values.
void setValues(List<? extends Value> values)
Replaces all array components with other values.
String toString()
Returns a string representation of the object.
Protected Methods
ClassTypeImpl invokableReferenceType(Method method)
[Expand]
Inherited Methods
From class com.sun.tools.jdi.ObjectReferenceImpl
From class java.lang.Object
From interface com.sun.jdi.ArrayReference
From interface com.sun.jdi.Mirror
From interface com.sun.jdi.ObjectReference
From interface com.sun.jdi.Value

Public Methods

public Value getValue (int index)

Returns an array component value.

Parameters
index the index of the component to retrieve
Returns
  • the Value at the given index.

public List<Value> getValues (int index, int length)

Returns a range of array components.

Parameters
index the index of the first component to retrieve
length the number of components to retrieve, or -1 to retrieve all components to the end of this array.
Returns
  • a list of Value objects, one for each requested array component ordered by array index. When there are no elements in the specified range (e.g. length is zero) an empty list is returned

public List<Value> getValues ()

Returns all of the components in this array.

Returns
  • a list of Value objects, one for each array component ordered by array index. For zero length arrays, an empty list is returned.

public int length ()

Return array length. Need not be synchronized since it cannot be provably stale.

Returns
  • the integer count of components in this array.

public void setValue (int index, Value value)

Replaces an array component with another value.

Object values must be assignment compatible with the component type (This implies that the component type must be loaded through the declaring class's class loader). Primitive values must be either assignment compatible with the component type or must be convertible to the component type without loss of information. See JLS section 5.2 for more information on assignment compatibility.

Parameters
index the index of the component to set
value the new value

public void setValues (int index, List<? extends Value> values, int srcIndex, int length)

Replaces a range of array components with other values.

Object values must be assignment compatible with the component type (This implies that the component type must be loaded through the enclosing class's class loader). Primitive values must be either assignment compatible with the component type or must be convertible to the component type without loss of information. See JLS section 5.2 for more information on assignment compatibility.

Parameters
index the index of the first component to set.
values a list of Value objects to be placed in this array.
srcIndex the index of the first source value to use.
length the number of components to set, or -1 to set all components to the end of this array or the end of values (whichever comes first).

public void setValues (List<? extends Value> values)

Replaces all array components with other values. If the given list is larger in size than the array, the values at the end of the list are ignored.

Object values must be assignment compatible with the element type (This implies that the component type must be loaded through the enclosing class's class loader). Primitive values must be either assignment compatible with the component type or must be convertible to the component type without loss of information. See JLS section 5.2 for more information on assignment compatibility.

Parameters
values a list of Value objects to be placed in this array. If values.size() is less that the length of the array, the first values.size() elements are set.

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.

Protected Methods

protected ClassTypeImpl invokableReferenceType (Method method)