Package org.eclipse.jdt.internal.compiler.impl

Examples of org.eclipse.jdt.internal.compiler.impl.Constant.booleanValue()


   */
  private static boolean isOptimizedTrue(Expression condition) {
    if (condition != null) {
      Constant cst = condition.optimizedBooleanConstant();
      if (cst != Constant.NotAConstant) {
        if (cst.booleanValue()) {
          return true;
        }
      }
    }
    return false;
View Full Code Here


          case TypeIds.T_byte : return new Byte(constant.byteValue());
          case TypeIds.T_short : return new Short(constant.shortValue());
          case TypeIds.T_char : return new Character(constant.charValue());
          case TypeIds.T_float : return new Float(constant.floatValue());
          case TypeIds.T_double : return new Double(constant.doubleValue());
          case TypeIds.T_boolean : return constant.booleanValue() ? Boolean.TRUE : Boolean.FALSE;
          case TypeIds.T_long : return new Long(constant.longValue());
          case TypeIds.T_JavaLangString : return constant.stringValue();
        }
        return null;
      }
View Full Code Here

  public Object getConstantValue() {
    Constant c = this.binding.constant();
    if (c == null || c == Constant.NotAConstant) return null;
    switch (c.typeID()) {
      case TypeIds.T_boolean:
        return Boolean.valueOf(c.booleanValue());
      case TypeIds.T_byte:
        return new Byte(c.byteValue());
      case TypeIds.T_char:
        return new Character(c.charValue());
      case TypeIds.T_double:
View Full Code Here

      case TypeIds.T_float :
        return currentConstant.floatValue() != otherConstant.floatValue();
      case TypeIds.T_double :
        return currentConstant.doubleValue() != otherConstant.doubleValue();
      case TypeIds.T_boolean :
        return currentConstant.booleanValue() != otherConstant.booleanValue();
      case TypeIds.T_JavaLangString :
        return !currentConstant.stringValue().equals(otherConstant.stringValue());
    }
  }
  return false;
View Full Code Here

   */
  private static boolean isOptimizedFalse(Expression condition) {
    if (condition != null) {
      Constant cst = condition.optimizedBooleanConstant();
      if (cst != Constant.NotAConstant) {
        if (cst.booleanValue() == false) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

   */
  private static boolean isOptimizedTrue(Expression condition) {
    if (condition != null) {
      Constant cst = condition.optimizedBooleanConstant();
      if (cst != Constant.NotAConstant) {
        if (cst.booleanValue()) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

   */
  private static boolean isOptimizedFalse(Expression condition) {
    if (condition != null) {
      Constant cst = condition.optimizedBooleanConstant();
      if (cst != Constant.NotAConstant) {
        if (cst.booleanValue() == false) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

   */
  private static boolean isOptimizedTrue(Expression condition) {
    if (condition != null) {
      Constant cst = condition.optimizedBooleanConstant();
      if (cst != Constant.NotAConstant) {
        if (cst.booleanValue() == true) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

      attributesNumber++;
      // Need to add the constant_value_index
      switch (fieldConstant.typeID()) {
        case T_boolean :
          int booleanValueIndex =
            this.constantPool.literalIndex(fieldConstant.booleanValue() ? 1 : 0);
          this.contents[this.contentsOffset++] = (byte) (booleanValueIndex >> 8);
          this.contents[this.contentsOffset++] = (byte) booleanValueIndex;
          break;
        case T_byte :
        case T_char :
View Full Code Here

  Constant cst = optimizedBooleanConstant();
  generateCode(currentScope, codeStream, valueRequired && cst == Constant.NotAConstant);
  if ((cst != Constant.NotAConstant) && (cst.typeID() == TypeIds.T_boolean)) {
    int pc = codeStream.position;
    if (cst.booleanValue() == true) {
      // constant == true
      if (valueRequired) {
        if (falseLabel == null) {
          // implicit falling through the FALSE case
          if (trueLabel != null) {
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.