Examples of IJavaArray


Examples of org.eclipse.jdt.debug.core.IJavaArray

  @Override
  public void execute() throws CoreException {

    IJavaArrayType arrayType = getArrayType(
        fTypeSignature.replace('/', '.'), fDimensions);
    IJavaArray array = arrayType.newInstance(fLength);

    for (int i = fLength - 1; i >= 0; i--) {
      array.setValue(i, popValue());
    }

    push(array);

  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaArray

    super(start);
  }

  @Override
  public void execute() throws CoreException {
    IJavaArray receiver = popArray();
    int length = receiver.getLength();
    pushNewValue(length);
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaArray

  }

  @Override
  public void execute() throws CoreException {
    int index = ((IJavaPrimitiveValue) popValue()).getIntValue();
    IJavaArray array = popArray();
    if (index >= array.getLength() || index < 0) {
      throw new CoreException(
          new Status(
              IStatus.ERROR,
              JDIDebugPlugin.getUniqueIdentifier(),
              IStatus.OK,
              MessageFormat
                  .format(InstructionsEvaluationMessages.ArrayAccess_illegal_index,
                      new Object[] { new Integer(index) }),
              null));
    }
    push(array.getVariable(index));
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaArray

   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    if (fHasInitializer) {
      IJavaArray array = (IJavaArray) popValue();
      pop(); // pop the type
      push(array);
    } else {

      int[] exprDimensions = new int[fExprDimension];

      for (int i = fExprDimension - 1; i >= 0; i--) {
        exprDimensions[i] = ((IJavaPrimitiveValue) popValue())
            .getIntValue();
      }

      IJavaType type = (IJavaType) pop();

      fCachedArrayTypes = new IJavaArrayType[fDimension + 1];

      for (int i = fDimension, lim = fDimension - fExprDimension; i > lim; i--) {
        fCachedArrayTypes[i] = (IJavaArrayType) type;
        type = ((IJavaArrayType) type).getComponentType();
      }

      IJavaArray array = createArray(fDimension, exprDimensions);

      push(array);
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaArray

   * Create and populate an array.
   */
  private IJavaArray createArray(int dimension, int[] exprDimensions)
      throws CoreException {

    IJavaArray array = fCachedArrayTypes[dimension]
        .newInstance(exprDimensions[0]);

    if (exprDimensions.length > 1) {
      int[] newExprDimension = new int[exprDimensions.length - 1];
      for (int i = 0; i < newExprDimension.length; i++) {
        newExprDimension[i] = exprDimensions[i + 1];
      }

      for (int i = 0; i < exprDimensions[0]; i++) {
        array.setValue(i, createArray(dimension - 1, newExprDimension));
      }

    }

    return array;
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaArray

    }
   
    private IVariable[] getWorkingMemoryElements(IJavaObject stackObj) throws DebugException {
        IValue objects = DebugUtil.getValueByExpression("return iterateObjectsToList().toArray();", stackObj);
        if (objects instanceof IJavaArray) {
            IJavaArray array = (IJavaArray) objects;
            List result = new ArrayList();
           
            IJavaValue[] vals = array.getValues();
           
            for ( int i = 0; i < vals.length; i++ ) {
                result.add(new MyJavaVariable("[" + i + "]", vals[i]));
            }
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.