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

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


      return true;
    if (!currentConstant.getClass().equals(otherConstant.getClass()))
      return true;
    switch (currentConstant.typeID()) {
      case TypeIds.T_int :
        return currentConstant.intValue() != otherConstant.intValue();
      case TypeIds.T_byte :
        return currentConstant.byteValue() != otherConstant.byteValue();
      case TypeIds.T_short :
        return currentConstant.shortValue() != otherConstant.shortValue();
      case TypeIds.T_char :
View Full Code Here


        int counter = 0;
        for (int i = 0; i < length; i++) {
          Constant constant;
          final Statement statement = this.statements[i];
          if ((constant = statement.resolveCase(this.scope, expressionType, this)) != Constant.NotAConstant) {
            int key = constant.intValue();
            //----check for duplicate case statement------------
            for (int j = 0; j < counter; j++) {
              if (this.constants[j] == key) {
                final CaseStatement currentCaseStatement = (CaseStatement) statement;
                if (duplicateCaseStatements == null) {
View Full Code Here

        case T_byte :
        case T_char :
        case T_int :
        case T_short :
          int integerValueIndex =
            this.constantPool.literalIndex(fieldConstant.intValue());
          this.contents[this.contentsOffset++] = (byte) (integerValueIndex >> 8);
          this.contents[this.contentsOffset++] = (byte) integerValueIndex;
          break;
        case T_float :
          int floatValueIndex =
View Full Code Here

          if (((assignConstant = expression.constant) != Constant.NotAConstant)
              && (assignConstant.typeID() != TypeIds.T_float) // only for integral types
              && (assignConstant.typeID() != TypeIds.T_double)) {// TODO (philippe) is this test needed ?
            switch (operator) {
              case PLUS :
                int increment  = assignConstant.intValue();
                if (increment != (short) increment) break; // not representable as a 16-bits value
                codeStream.iinc(localBinding.resolvedPosition, increment);
                if (valueRequired) {
                  codeStream.load(localBinding);
                }
View Full Code Here

                if (valueRequired) {
                  codeStream.load(localBinding);
                }
                return;
              case MINUS :
                increment  = -assignConstant.intValue();
                if (increment != (short) increment) break; // not representable as a 16-bits value
                codeStream.iinc(localBinding.resolvedPosition, increment);
                if (valueRequired) {
                  codeStream.load(localBinding);
                }
View Full Code Here

      case TypeIds.T_double:
        return constant.doubleValue();
      case TypeIds.T_float:
        return constant.floatValue();
      case TypeIds.T_int:
        return constant.intValue();
      case TypeIds.T_JavaLangString:
        return constant.stringValue();
      case TypeIds.T_long:
        return constant.longValue();
      case TypeIds.T_short:
View Full Code Here

      return true;
    if (!currentConstant.getClass().equals(otherConstant.getClass()))
      return true;
    switch (currentConstant.typeID()) {
      case TypeIds.T_int :
        return currentConstant.intValue() != otherConstant.intValue();
      case TypeIds.T_byte :
        return currentConstant.byteValue() != otherConstant.byteValue();
      case TypeIds.T_short :
        return currentConstant.shortValue() != otherConstant.shortValue();
      case TypeIds.T_char :
View Full Code Here

      case TypeIds.T_double:
        return new Double(c.doubleValue());
      case TypeIds.T_float:
        return new Float(c.floatValue());
      case TypeIds.T_int:
        return new Integer(c.intValue());
      case TypeIds.T_long:
        return new Long(c.longValue());
      case TypeIds.T_short:
        return new Short(c.shortValue());
      case TypeIds.T_JavaLangString:
View Full Code Here

          if ((assignConstant != Constant.NotAConstant)
              && (assignConstant.typeID() != TypeIds.T_float) // only for integral types
              && (assignConstant.typeID() != TypeIds.T_double)) { // TODO (philippe) is this test needed ?
            switch (operator) {
              case PLUS :
                int increment  = assignConstant.intValue();
                if (increment != (short) increment) break; // not representable as a 16-bits value
                codeStream.iinc(localBinding.resolvedPosition, increment);
                if (valueRequired) {
                  codeStream.load(localBinding);
                }
View Full Code Here

                if (valueRequired) {
                  codeStream.load(localBinding);
                }
                return;
              case MINUS :
                increment  = -assignConstant.intValue();
                if (increment != (short) increment) break; // not representable as a 16-bits value
                codeStream.iinc(localBinding.resolvedPosition, increment);
                if (valueRequired) {
                  codeStream.load(localBinding);
                }
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.