本文整理汇总了Java中com.sun.jdi.ArrayReference.getValues方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayReference.getValues方法的具体用法?Java ArrayReference.getValues怎么用?Java ArrayReference.getValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jdi.ArrayReference
的用法示例。
在下文中一共展示了ArrayReference.getValues方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitArrayCells
import com.sun.jdi.ArrayReference; //导入方法依赖的package包/类
private boolean visitArrayCells(final Location location, final StackFrame frame,
final ArrayReference arrayRef, final IContextContour array)
{
boolean modified = false;
// retrieve the array values
final List<Value> values = arrayRef.length() > 0 ? arrayRef.getValues() : null;
// check for modifications on each of the array cells
for (int i = 0; values != null && i < values.size(); i++)
{
final IContourMember cell = array.lookupMember(i);
final Value cellValue = values.get(i);
// recursively process the array reference value
if (cellValue instanceof ArrayReference)
{
if (!handleNewArray((ArrayReference) cellValue, location, frame)
&& EventFactoryAdapter.PROCESS_MULTI_ARRAY)
{
final ArrayReference innerArray = (ArrayReference) cellValue;
// retrieve the array reference type
final ArrayType at = (ArrayType) cellValue.type();
// retrieve the array contour
final IContextContour innerContour = contourFactory().lookupInstanceContour(at.name(),
innerArray.uniqueID());
visitArrayCells(location, frame, innerArray, innerContour);
}
}
// true if the variable was newly observed or its value changed
if (executionState().observedVariable(cell, cellValue, frame.thread(), location.lineNumber()))
{
// dispatch the assignment to the modified cell
dispatcher().dispatchArrayCellWriteEvent(location, frame.thread(), array, cell, cellValue,
((ArrayType) arrayRef.type()).componentTypeName());
modified = true;
}
}
return modified;
}
示例2: getValues
import com.sun.jdi.ArrayReference; //导入方法依赖的package包/类
protected static List<Value> getValues(ArrayReference value) {
if (value.length() == 0)
return new ArrayList<Value>(0);
else
return value.getValues();
}
示例3: getArrayFromArrayReference
import com.sun.jdi.ArrayReference; //导入方法依赖的package包/类
private Data getArrayFromArrayReference(boolean forceWriteContent, String name,ArrayReference value, List<Long> objectsProcessed) {
Data object = null;
long arrayID = value.uniqueID();
if (forceWriteContent || !isExcludedClass(value)){
if (objectsProcessed.contains(arrayID)){
object = new ObjectData(name,value.uniqueID(),null,null,null,getClass(value.referenceType())+ "[]");
} else {
List<Data> elements = new ArrayList<>();
List<Value> values = value.getValues();
objectsProcessed.add(arrayID);
for (int i=0;i<values.size();i++){
Value v = values.get(i);
elements.add(getObj("["+i+"]",v,objectsProcessed));
}
object = new ArrayData(name,arrayID,elements,value.length(),getClass(value.referenceType()));
}
} else {
object = new IgnoredData(getClass(value.referenceType()),name);
}
return object;
}