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

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


            Constant constant = mBinding.constant();
            if (constant != null) {
                if (constant instanceof StringConstant) {
                    return constant.stringValue();
                } else if (constant instanceof IntConstant) {
                    return constant.intValue();
                } else if (constant instanceof BooleanConstant) {
                    return constant.booleanValue();
                } else if (constant instanceof LongConstant) {
                    return constant.longValue();
                } else if (constant instanceof DoubleConstant) {
View Full Code Here


        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) {
            if (!isStringSwitch) {
              int key = constant.intValue();
              //----check for duplicate case statement------------
              for (int j = 0; j < counter; j++) {
                if (this.constants[j] == key) {
                  reportDuplicateCase((CaseStatement) statement, this.cases[j], length);
                }
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

            Constant constant = mBinding.constant();
            if (constant != null) {
                if (constant instanceof StringConstant) {
                    return constant.stringValue();
                } else if (constant instanceof IntConstant) {
                    return constant.intValue();
                } else if (constant instanceof BooleanConstant) {
                    return constant.booleanValue();
                } else if (constant instanceof LongConstant) {
                    return constant.longValue();
                } else if (constant instanceof DoubleConstant) {
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.