• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BooleanValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.jdi.BooleanValue的典型用法代码示例。如果您正苦于以下问题:Java BooleanValue类的具体用法?Java BooleanValue怎么用?Java BooleanValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BooleanValue类属于com.sun.jdi包,在下文中一共展示了BooleanValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: writeUntaggedValueChecked

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
void writeUntaggedValueChecked(Value val) throws InvalidTypeException {
    byte tag = ValueImpl.typeValueKey(val);
    if (isObjectTag(tag)) {
        if (val == null) {
             writeObjectRef(0);
        } else {
            if (!(val instanceof ObjectReference)) {
                throw new InvalidTypeException();
            }
            writeObjectRef(((ObjectReferenceImpl)val).ref());
        }
    } else {
        switch (tag) {
            case JDWP.Tag.BYTE:
                if(!(val instanceof ByteValue))
                    throw new InvalidTypeException();

                writeByte(((PrimitiveValue)val).byteValue());
                break;

            case JDWP.Tag.CHAR:
                if(!(val instanceof CharValue))
                    throw new InvalidTypeException();

                writeChar(((PrimitiveValue)val).charValue());
                break;

            case JDWP.Tag.FLOAT:
                if(!(val instanceof FloatValue))
                    throw new InvalidTypeException();

                writeFloat(((PrimitiveValue)val).floatValue());
                break;

            case JDWP.Tag.DOUBLE:
                if(!(val instanceof DoubleValue))
                    throw new InvalidTypeException();

                writeDouble(((PrimitiveValue)val).doubleValue());
                break;

            case JDWP.Tag.INT:
                if(!(val instanceof IntegerValue))
                    throw new InvalidTypeException();

                writeInt(((PrimitiveValue)val).intValue());
                break;

            case JDWP.Tag.LONG:
                if(!(val instanceof LongValue))
                    throw new InvalidTypeException();

                writeLong(((PrimitiveValue)val).longValue());
                break;

            case JDWP.Tag.SHORT:
                if(!(val instanceof ShortValue))
                    throw new InvalidTypeException();

                writeShort(((PrimitiveValue)val).shortValue());
                break;

            case JDWP.Tag.BOOLEAN:
                if(!(val instanceof BooleanValue))
                    throw new InvalidTypeException();

                writeBoolean(((PrimitiveValue)val).booleanValue());
                break;
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:72,代码来源:PacketStream.java


示例2: testValueOf

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
@Test
public void testValueOf() throws Exception {
    Map<String, Object> options = formatter.getDefaultOptions();
    Value boolVar = getVM().mirrorOf(true);
    Value newValue = formatter.valueOf("true", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertTrue("should return boolean type", ((BooleanValue)newValue).value());
    assertEquals("Should be able to restore boolean value.", "true",
        formatter.toString(newValue, options));

    newValue = formatter.valueOf("True", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertTrue("should return boolean type", ((BooleanValue)newValue).value());

    newValue = formatter.valueOf("false", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertFalse("should return boolean 'false'", ((BooleanValue)newValue).value());

    newValue = formatter.valueOf("False", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertFalse("should return boolean 'false'", ((BooleanValue)newValue).value());

    newValue = formatter.valueOf("abc", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertFalse("should return boolean 'false'", ((BooleanValue)newValue).value());
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:27,代码来源:BooleanFormatterTest.java


示例3: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value;
  while (true) {
    value = myConditionEvaluator.evaluate(context);
    if (!(value instanceof BooleanValue)) {
      throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
    }
    else {
      if (!((BooleanValue)value).booleanValue()) {
        break;
      }
    }

    if (body(context)) break;
  }

  return value;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:WhileStatementEvaluator.java


示例4: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value = context.getDebugProcess().getVirtualMachineProxy().mirrorOfVoid();
  while (true) {
    if (body(context)) break;

    value = myConditionEvaluator.evaluate(context);
    if (!(value instanceof BooleanValue)) {
      throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
    }
    else {
      if (!((BooleanValue)value).booleanValue()) {
        break;
      }
    }
  }

  return value;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DoWhileStatementEvaluator.java


示例5: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value = context.getDebugProcess().getVirtualMachineProxy().mirrorOfVoid();
  value = evaluateInitialization(context, value);

  while (true) {
    // condition
    Object codition = evaluateCondition(context);
    if (codition instanceof Boolean) {
      if (!(Boolean)codition) break;
    }
    else if (codition instanceof BooleanValue) {
      if (!((BooleanValue)codition).booleanValue()) break;
    }
    else {
      throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
    }

    // body
    if (body(context)) break;

    // update
    value = evaluateUpdate(context, value);
  }

  return value;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ForStatementEvaluatorBase.java


示例6: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value = myConditionEvaluator.evaluate(context);
  if(!(value instanceof BooleanValue)) {
    throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
  } else {
    if(((BooleanValue)value).booleanValue()) {
      value = myThenEvaluator.evaluate(context);
      myModifier = myThenEvaluator.getModifier();
    }
    else {
      if(myElseEvaluator != null) {
        value = myElseEvaluator.evaluate(context);
        myModifier = myElseEvaluator.getModifier();
      } else {
        value = context.getDebugProcess().getVirtualMachineProxy().mirrorOfVoid();
        myModifier = null;
      }
    }
  }
  return value;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:IfStatementEvaluator.java


示例7: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value = myConditionEvaluator.evaluate(context);
  if(!(value instanceof BooleanValue)) {
    throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
  } else {
    if(((BooleanValue)value).booleanValue()) {
      value = myThenEvaluator.evaluate(context);
      myModifier = myThenEvaluator.getModifier();
    }
    else {
      if(myElseEvaluator != null) {
        value = myElseEvaluator.evaluate(context);
        myModifier = myElseEvaluator.getModifier();
      } else {
        value = context.getDebugProcess().getVirtualMachineProxy().mirrorOf();
        myModifier = null;
      }
    }
  }
  return value;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:IfStatementEvaluator.java


示例8: testEvaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
@Test
public void testEvaluate() throws Throwable {
	ObjectReference promise = remote.evaluateForked("3+4");
	ThreadReference thread = ((ThreadReference) remote.invokeMethod(
			promise, "thread"));
	Value result1 = remote.invokeMethod(promise, "result");
	Value ex = remote.invokeMethod(promise, "throwable");
	printThreadState();
	VMTargetStarter.sleep(100);
	printThreadState();

	boolean isFinished = ((BooleanValue) remote.invokeMethod(promise,
			"isFinished")).booleanValue();

	assertTrue(isFinished);
	ObjectReference result = (ObjectReference) remote.invokeMethod(promise,
			"result");
	IntegerValue intValue = (IntegerValue) remote.invokeMethod(result,
			"intValue");
	assertEquals(7, intValue.intValue());
}
 
开发者ID:gravel-st,项目名称:gravel,代码行数:22,代码来源:VMTargetRemoteTest.java


示例9: getPrimitiveObject

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
private Data getPrimitiveObject(String name, Value value) {
	Data object = null;
	if (value instanceof BooleanValue)
		object = new SimpleData(name,((BooleanValue) value).booleanValue());
	else if (value instanceof ByteValue)
		object = new SimpleData(name,((ByteValue) value).byteValue());
	else if (value instanceof CharValue)
		object = new SimpleData(name,((CharValue) value).charValue());
	else if (value instanceof DoubleValue)
		object = new SimpleData(name,((DoubleValue) value).doubleValue());
	else if (value instanceof FloatValue)
		object = new SimpleData(name,((FloatValue) value).floatValue());
	else if (value instanceof IntegerValue)
		object = new SimpleData(name,((IntegerValue) value).intValue());
	else if (value instanceof LongValue)
		object = new SimpleData(name,((LongValue) value).longValue());
	else if (value instanceof ShortValue)
		object = new SimpleData(name,((ShortValue)value).shortValue());
	return object;
}
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:21,代码来源:ClassUtils.java


示例10: retrieveScreenshots

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
private static void retrieveScreenshots(JPDAThreadImpl t, final ThreadReference tr, VirtualMachine vm, DebuggerEngine engine, JPDADebuggerImpl d, final List<RemoteScreenshot> screenshots) throws RetrievalException {
    try {
        final ClassType windowClass = getClass(vm, tr, "javafx.stage.Window");
        
        Method getWindows = windowClass.concreteMethodByName("impl_getWindows", "()Ljava/util/Iterator;");
        Method windowName = windowClass.concreteMethodByName("impl_getMXWindowType", "()Ljava/lang/String;");

        ObjectReference iterator = (ObjectReference)windowClass.invokeMethod(tr, getWindows, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
        ClassType iteratorClass = (ClassType)iterator.referenceType();
        Method hasNext = iteratorClass.concreteMethodByName("hasNext", "()Z");
        Method next = iteratorClass.concreteMethodByName("next", "()Ljava/lang/Object;");
        
        boolean nextFlag = false;
        do {
            BooleanValue bv = (BooleanValue)iterator.invokeMethod(tr, hasNext, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
            nextFlag = bv.booleanValue();
            if (nextFlag) {
                ObjectReference window = (ObjectReference)iterator.invokeMethod(tr, next, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
                StringReference name = (StringReference)window.invokeMethod(tr, windowName, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
                SGComponentInfo windowInfo = new SGComponentInfo(t, window);
                
                screenshots.add(createRemoteFXScreenshot(engine, vm, tr, name.value(), window, windowInfo));
            }
        } while (nextFlag);
    } catch (Exception e) {
        throw new RetrievalException(e.getMessage(), e);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:RemoteFXScreenshot.java


示例11: pauseMedia

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
private static void pauseMedia(ThreadReference tr, VirtualMachine vm) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException {
    final ClassType audioClipClass = getClass(vm, tr, "com.sun.media.jfxmedia.AudioClip");
    final ClassType mediaManagerClass = getClass(vm, tr, "com.sun.media.jfxmedia.MediaManager");
    final InterfaceType mediaPlayerClass = getInterface(vm, tr, "com.sun.media.jfxmedia.MediaPlayer");
    final ClassType playerStateEnum = getClass(vm, tr, "com.sun.media.jfxmedia.events.PlayerStateEvent$PlayerState");
    
    if (audioClipClass != null) {
        Method stopAllClips = audioClipClass.concreteMethodByName("stopAllClips", "()V");
        audioClipClass.invokeMethod(tr, stopAllClips, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
    }
    
    if (mediaManagerClass != null && mediaPlayerClass != null && playerStateEnum != null) {
        Method getAllPlayers = mediaManagerClass.concreteMethodByName("getAllMediaPlayers", "()Ljava/util/List;");

        ObjectReference plList = (ObjectReference)mediaManagerClass.invokeMethod(tr, getAllPlayers, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);

        if (plList != null) {
            ClassType listType = (ClassType)plList.referenceType();
            Method iterator = listType.concreteMethodByName("iterator", "()Ljava/util/Iterator;");
            ObjectReference plIter = (ObjectReference)plList.invokeMethod(tr, iterator, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);

            ClassType iterType = (ClassType)plIter.referenceType();
            Method hasNext = iterType.concreteMethodByName("hasNext", "()Z");
            Method next = iterType.concreteMethodByName("next", "()Ljava/lang/Object;");


            Field playingState = playerStateEnum.fieldByName("PLAYING");

            Method getState = mediaPlayerClass.methodsByName("getState", "()Lcom/sun/media/jfxmedia/events/PlayerStateEvent$PlayerState;").get(0);
            Method pausePlayer = mediaPlayerClass.methodsByName("pause", "()V").get(0);
            boolean hasNextFlag = false;
            do {
                BooleanValue v = (BooleanValue)plIter.invokeMethod(tr, hasNext, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
                hasNextFlag = v.booleanValue();
                if (hasNextFlag) {
                    ObjectReference player = (ObjectReference)plIter.invokeMethod(tr, next, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
                    ObjectReference curState = (ObjectReference)player.invokeMethod(tr, getState, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
                    if (playingState.equals(curState)) {
                        player.invokeMethod(tr, pausePlayer, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
                        pausedPlayers.add(player);
                    }
                }
            } while (hasNextFlag);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:47,代码来源:RemoteFXScreenshot.java


示例12: sendStopUserCode

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public boolean sendStopUserCode() throws IllegalStateException {
    if (closed) {
        return false;
    }
    vm.suspend();
    try {
        ObjectReference myRef = getAgentObjectReference();

        OUTER:
        for (ThreadReference thread : vm.allThreads()) {
            // could also tag the thread (e.g. using name), to find it easier
            AGENT: for (StackFrame frame : thread.frames()) {
                if (REMOTE_AGENT_CLASS.equals(frame.location().declaringType().name())) {
                    String n = frame.location().method().name();
                    if (AGENT_INVOKE_METHOD.equals(n) || AGENT_VARVALUE_METHOD.equals(n)) {
                        ObjectReference thiz = frame.thisObject();
                        if (myRef != null && myRef != thiz) {
                            break AGENT;
                        }
                        if (((BooleanValue) thiz.getValue(thiz.referenceType().fieldByName("inClientCode"))).value()) {
                            thiz.setValue(thiz.referenceType().fieldByName("expectingStop"), vm.mirrorOf(true));
                            ObjectReference stopInstance = (ObjectReference) thiz.getValue(thiz.referenceType().fieldByName("stopException"));
                            vm.resume();
                            thread.stop(stopInstance);
                            thiz.setValue(thiz.referenceType().fieldByName("expectingStop"), vm.mirrorOf(false));
                        }
                        return true;
                    }
                }
            }
        }
    } catch (ClassNotLoadedException | IncompatibleThreadStateException | InvalidTypeException ex) {
        throw new IllegalStateException(ex);
    } finally {
        vm.resume();
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:DebugExecutionEnvironment.java


示例13: evaluateCondition

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
private boolean evaluateCondition(Tree arg0, EvaluationContext evaluationContext, ExpressionTree condition) {
    Mirror conditionValue = condition.accept(this, evaluationContext);
    if (conditionValue instanceof ObjectReference) {
        conditionValue = unboxIfCan(arg0, (ObjectReference) conditionValue, evaluationContext);
    }
    if (!(conditionValue instanceof BooleanValue)) {
        String type = "N/A";    // NOI18N
        if (conditionValue instanceof Value) {
            type = ((Value) conditionValue).type().name();
        }
        Assert.error(arg0, "notABoolean", condition.toString(), conditionValue, type);
    }
    return ((BooleanValue) conditionValue).value();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:EvaluatorVisitor.java


示例14: checkedBooleanValue

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
final boolean checkedBooleanValue() throws InvalidTypeException {
    /*
     * Always disallow a conversion to boolean from any other
     * primitive
     */
    if (this instanceof BooleanValue) {
        return booleanValue();
    } else {
        throw new InvalidTypeException("Can't convert non-boolean value to boolean");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:PrimitiveValueImpl.java


示例15: equals

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public boolean equals(Object obj) {
    if ((obj != null) && (obj instanceof BooleanValue)) {
        return (value == ((BooleanValue)obj).value()) &&
               super.equals(obj);
    } else {
        return false;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:BooleanValueImpl.java


示例16: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
@Override
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Value condition = (Value)myConditionEvaluator.evaluate(context);
  if (condition == null || !(condition instanceof BooleanValue)) {
    throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.boolean.condition.expected"));
  }
  return ((BooleanValue)condition).booleanValue()? myThenEvaluator.evaluate(context) : myElseEvaluator.evaluate(context);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ConditionalExpressionEvaluator.java


示例17: wrap

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public static F3Value wrap(F3VirtualMachine f3vm, Value value) {
    if (value == null) {
        return null;
    }

    if (value instanceof PrimitiveValue) {
        if (value instanceof BooleanValue) {
            return f3vm.booleanValue((BooleanValue)value);
        } else if (value instanceof CharValue) {
            return f3vm.charValue((CharValue)value);
        } else if (value instanceof ByteValue) {
            return f3vm.byteValue((ByteValue)value);
        } else if (value instanceof ShortValue) {
            return f3vm.shortValue((ShortValue)value);
        } else if (value instanceof IntegerValue) {
            return f3vm.integerValue((IntegerValue)value);
        } else if (value instanceof LongValue) {
            return f3vm.longValue((LongValue)value);
        } else if (value instanceof FloatValue) {
            return f3vm.floatValue((FloatValue)value);
        } else if (value instanceof DoubleValue) {
            return f3vm.doubleValue((DoubleValue)value);
        } else {
            throw new IllegalArgumentException("illegal primitive value : " + value);
        }
    } else if (value instanceof VoidValue) {
        return f3vm.voidValue();
    } else if (value instanceof ObjectReference) {
        return  wrap(f3vm, (ObjectReference)value);
    } else {
        throw new IllegalArgumentException("illegal value: " + value);
    }
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:34,代码来源:F3Wrapper.java


示例18: setValue

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
/**
 * Replace a sequence element with another value.
 *
 * Object values must be assignment compatible with the element type.
 * (This implies that the component type must be loaded through the
 * declaring class's class loader). Primitive values must be
 * assignment compatible with the component type.
 *
 * @param value the new value
 * @param index the index of the component to set.  If this is beyond the 
 * end of the sequence, the new value is appended to the sequence.
 *
 * @throws InvalidTypeException if the type of <CODE><I>value</I></CODE>
 * is not compatible with the declared type of sequence elements.
 * @throws ClassNotLoadedException if the sequence element type
 * has not yet been loaded through the appropriate class loader.
 * @throws VMCannotBeModifiedException if the VirtualMachine is read-only - see {@link com.sun.jdi.VirtualMachine#canBeModified()}.
 * @return a new sequence with the specified element replaced/added.
 */
public F3SequenceReference setValue(int index, Value value) {
    Types type = getElementType();
    switch (type) {
        case INT:
            return setIntValue(index, (IntegerValue)value);
        case FLOAT:
            return setFloatValue(index, (FloatValue)value);
        case OBJECT:
            return setObjectValue(index, (ObjectReference)value);
        case DOUBLE:
            return setDoubleValue(index, (DoubleValue)value);
        case BOOLEAN:
            return setBooleanValue(index, (BooleanValue)value);
        case LONG:
            return setLongValue(index, (LongValue)value);
        case SHORT:
            return setShortValue(index, (ShortValue)value);
        case BYTE:
            return setByteValue(index, (ByteValue)value);
        case CHAR:
            return setCharValue(index, (CharValue)value);
        case OTHER:
            return setObjectValue(index, (ObjectReference)value);
        default:
            throw new IllegalArgumentException("Invalid sequence element type");
    }
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:47,代码来源:F3SequenceReference.java


示例19: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Value value = (Value)myOperandEvaluator.evaluate(context);
  if (value == null) {
    if (myIsPrimitive) {
      throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.cannot.cast.null", myCastType));
    }
    return null;
  }
  VirtualMachineProxyImpl vm = context.getDebugProcess().getVirtualMachineProxy();
  if (DebuggerUtilsEx.isInteger(value)) {
    value = DebuggerUtilsEx.createValue(vm, myCastType, ((PrimitiveValue)value).longValue());
    if (value == null) {
      throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.cannot.cast.numeric", myCastType));
    }
  }
  else if (DebuggerUtilsEx.isNumeric(value)) {
    value = DebuggerUtilsEx.createValue(vm, myCastType, ((PrimitiveValue)value).doubleValue());
    if (value == null) {
      throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.cannot.cast.numeric", myCastType));
    }
  }
  else if (value instanceof BooleanValue) {
    value = DebuggerUtilsEx.createValue(vm, myCastType, ((BooleanValue)value).booleanValue());
    if (value == null) {
      throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.cannot.cast.boolean", myCastType));
    }
  }
  else if (value instanceof CharValue) {
    value = DebuggerUtilsEx.createValue(vm, myCastType, ((CharValue)value).charValue());
    if (value == null) {
      throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.cannot.cast.char", myCastType));
    }
  }
  return value;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:TypeCastEvaluator.java


示例20: evaluate

import com.sun.jdi.BooleanValue; //导入依赖的package包/类
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Value condition = (Value)myConditionEvaluator.evaluate(context);
  if (condition == null || !(condition instanceof BooleanValue)) {
    throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.boolean.condition.expected"));
  }
  return ((BooleanValue)condition).booleanValue()? myThenEvaluator.evaluate(context) : myElseEvaluator.evaluate(context);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:ConditionalExpressionEvaluator.java



注:本文中的com.sun.jdi.BooleanValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OWLClassAxiom类代码示例发布时间:2022-05-23
下一篇:
Java RealmChoiceCallback类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap