本文整理汇总了Java中org.eclipse.jdt.internal.compiler.lookup.TypeIds.T_double方法的典型用法代码示例。如果您正苦于以下问题:Java TypeIds.T_double方法的具体用法?Java TypeIds.T_double怎么用?Java TypeIds.T_double使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.lookup.TypeIds
的用法示例。
在下文中一共展示了TypeIds.T_double方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNegativeAnnotationMemberValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public static Object getNegativeAnnotationMemberValue(
MemberValuePair memberValuePair, Constant constant) {
if (constant == null) {
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
switch (constant.typeID()) {
case TypeIds.T_int:
memberValuePair.valueKind = IMemberValuePair.K_INT;
return new Integer(constant.intValue() * -1);
case TypeIds.T_float:
memberValuePair.valueKind = IMemberValuePair.K_FLOAT;
return new Float(constant.floatValue() * -1.0f);
case TypeIds.T_double:
memberValuePair.valueKind = IMemberValuePair.K_DOUBLE;
return new Double(constant.doubleValue() * -1.0);
case TypeIds.T_long:
memberValuePair.valueKind = IMemberValuePair.K_LONG;
return new Long(constant.longValue() * -1L);
default:
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
}
示例2: getNumberOfLocals
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public int getNumberOfLocals() {
if (this.numberOfLocals != -1) {
return this.numberOfLocals;
}
int result = 0;
final int length = this.locals == null ? 0 : this.locals.length;
for(int i = 0; i < length; i++) {
if (this.locals[i] != null) {
switch(this.locals[i].id()) {
case TypeIds.T_double :
case TypeIds.T_long :
i++;
}
result++;
}
}
this.numberOfLocals = result;
return result;
}
示例3: resolveConstantExpressionValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
Object resolveConstantExpressionValue(Expression expression) {
org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(expression);
if (node instanceof org.eclipse.jdt.internal.compiler.ast.Expression) {
org.eclipse.jdt.internal.compiler.ast.Expression compilerExpression = (org.eclipse.jdt.internal.compiler.ast.Expression) node;
Constant constant = compilerExpression.constant;
if (constant != null && constant != Constant.NotAConstant) {
switch (constant.typeID()) {
case TypeIds.T_int : return new Integer(constant.intValue());
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;
}
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:23,代码来源:DefaultBindingResolver.java
示例4: calculateValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Returns the actual value of the given Literal or Literal-like node.
*/
public static Object calculateValue(Expression e) {
if (e instanceof Literal) {
((Literal)e).computeConstant();
switch (e.constant.typeID()) {
case TypeIds.T_int: return e.constant.intValue();
case TypeIds.T_byte: return e.constant.byteValue();
case TypeIds.T_short: return e.constant.shortValue();
case TypeIds.T_char: return e.constant.charValue();
case TypeIds.T_float: return e.constant.floatValue();
case TypeIds.T_double: return e.constant.doubleValue();
case TypeIds.T_boolean: return e.constant.booleanValue();
case TypeIds.T_long: return e.constant.longValue();
case TypeIds.T_JavaLangString: return e.constant.stringValue();
default: return null;
}
} else if (e instanceof ClassLiteralAccess) {
return Eclipse.toQualifiedName(((ClassLiteralAccess)e).type.getTypeName());
} else if (e instanceof SingleNameReference) {
return new String(((SingleNameReference)e).token);
} else if (e instanceof QualifiedNameReference) {
String qName = Eclipse.toQualifiedName(((QualifiedNameReference)e).tokens);
int idx = qName.lastIndexOf('.');
return idx == -1 ? qName : qName.substring(idx+1);
}
return null;
}
示例5: getAnnotationMemberValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public static Object getAnnotationMemberValue(
MemberValuePair memberValuePair, Constant constant) {
if (constant == null) {
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
switch (constant.typeID()) {
case TypeIds.T_int:
memberValuePair.valueKind = IMemberValuePair.K_INT;
return new Integer(constant.intValue());
case TypeIds.T_byte:
memberValuePair.valueKind = IMemberValuePair.K_BYTE;
return new Byte(constant.byteValue());
case TypeIds.T_short:
memberValuePair.valueKind = IMemberValuePair.K_SHORT;
return new Short(constant.shortValue());
case TypeIds.T_char:
memberValuePair.valueKind = IMemberValuePair.K_CHAR;
return new Character(constant.charValue());
case TypeIds.T_float:
memberValuePair.valueKind = IMemberValuePair.K_FLOAT;
return new Float(constant.floatValue());
case TypeIds.T_double:
memberValuePair.valueKind = IMemberValuePair.K_DOUBLE;
return new Double(constant.doubleValue());
case TypeIds.T_boolean:
memberValuePair.valueKind = IMemberValuePair.K_BOOLEAN;
return Boolean.valueOf(constant.booleanValue());
case TypeIds.T_long:
memberValuePair.valueKind = IMemberValuePair.K_LONG;
return new Long(constant.longValue());
case TypeIds.T_JavaLangString:
memberValuePair.valueKind = IMemberValuePair.K_STRING;
return constant.stringValue();
default:
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
}
示例6: setBinding
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public void setBinding(TypeBinding binding) {
this.constantPoolName = binding.constantPoolName();
final int typeBindingId = binding.id;
this.id = typeBindingId;
switch(typeBindingId) {
case TypeIds.T_boolean :
case TypeIds.T_byte :
case TypeIds.T_char :
case TypeIds.T_int :
case TypeIds.T_short :
this.tag = VerificationTypeInfo.ITEM_INTEGER;
break;
case TypeIds.T_float :
this.tag = VerificationTypeInfo.ITEM_FLOAT;
break;
case TypeIds.T_long :
this.tag = VerificationTypeInfo.ITEM_LONG;
break;
case TypeIds.T_double :
this.tag = VerificationTypeInfo.ITEM_DOUBLE;
break;
case TypeIds.T_null :
this.tag = VerificationTypeInfo.ITEM_NULL;
break;
default:
this.tag = VerificationTypeInfo.ITEM_OBJECT;
}
}
示例7: convertConstant
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Converts a field constant from the compiler's representation
* to the Java Model constant representation (Number or String).
*/
protected static Object convertConstant(Constant constant) {
if (constant == null)
return null;
if (constant == Constant.NotAConstant) {
return null;
}
switch (constant.typeID()) {
case TypeIds.T_boolean :
return constant.booleanValue() ? Boolean.TRUE : Boolean.FALSE;
case TypeIds.T_byte :
return new Byte(constant.byteValue());
case TypeIds.T_char :
return new Character(constant.charValue());
case TypeIds.T_double :
return new Double(constant.doubleValue());
case TypeIds.T_float :
return new Float(constant.floatValue());
case TypeIds.T_int :
return new Integer(constant.intValue());
case TypeIds.T_long :
return new Long(constant.longValue());
case TypeIds.T_short :
return new Short(constant.shortValue());
case TypeIds.T_JavaLangString :
return constant.stringValue();
default :
return null;
}
}
示例8: hasSameValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Returns true if both constants have the same type and the same actual value
* @param otherConstant
*/
public boolean hasSameValue(Constant otherConstant) {
if (this == otherConstant)
return true;
int typeID;
if ((typeID = typeID()) != otherConstant.typeID())
return false;
switch (typeID) {
case TypeIds.T_boolean:
return booleanValue() == otherConstant.booleanValue();
case TypeIds.T_byte:
return byteValue() == otherConstant.byteValue();
case TypeIds.T_char:
return charValue() == otherConstant.charValue();
case TypeIds.T_double:
return doubleValue() == otherConstant.doubleValue();
case TypeIds.T_float:
return floatValue() == otherConstant.floatValue();
case TypeIds.T_int:
return intValue() == otherConstant.intValue();
case TypeIds.T_short:
return shortValue() == otherConstant.shortValue();
case TypeIds.T_long:
return longValue() == otherConstant.longValue();
case TypeIds.T_JavaLangString:
String value = stringValue();
return value == null
? otherConstant.stringValue() == null
: value.equals(otherConstant.stringValue());
}
return false;
}
示例9: generateAssignment
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
FieldBinding codegenBinding = this.binding.original();
if (codegenBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {
this.receiver.generateCode(currentScope, codeStream, !codegenBinding.isStatic());
assignment.expression.generateCode(currentScope, codeStream, true);
fieldStore(currentScope, codeStream, codegenBinding, null, this.actualReceiverType, this.receiver.isImplicitThis(), valueRequired);
} else {
codeStream.generateEmulationForField(codegenBinding);
this.receiver.generateCode(currentScope, codeStream, !codegenBinding.isStatic());
if (codegenBinding.isStatic()) { // need a receiver?
codeStream.aconst_null();
}
assignment.expression.generateCode(currentScope, codeStream, true);
if (valueRequired) {
switch (codegenBinding.type.id) {
case TypeIds.T_long :
case TypeIds.T_double :
codeStream.dup2_x2();
break;
default :
codeStream.dup_x2();
break;
}
}
codeStream.generateEmulatedWriteAccessForField(codegenBinding);
}
if (valueRequired){
codeStream.generateImplicitConversion(assignment.implicitConversion);
}
}
示例10: getWrappedConstantValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Return a wrapper that contains the constant of the field.
* @return java.lang.Object
*/
public Object getWrappedConstantValue() {
if (this.wrappedConstantValue == null) {
if (hasConstant()) {
Constant fieldConstant = getConstant();
switch (fieldConstant.typeID()) {
case TypeIds.T_int :
this.wrappedConstantValue = new Integer(fieldConstant.intValue());
break;
case TypeIds.T_byte :
this.wrappedConstantValue = new Byte(fieldConstant.byteValue());
break;
case TypeIds.T_short :
this.wrappedConstantValue = new Short(fieldConstant.shortValue());
break;
case TypeIds.T_char :
this.wrappedConstantValue = new Character(fieldConstant.charValue());
break;
case TypeIds.T_float :
this.wrappedConstantValue = new Float(fieldConstant.floatValue());
break;
case TypeIds.T_double :
this.wrappedConstantValue = new Double(fieldConstant.doubleValue());
break;
case TypeIds.T_boolean :
this.wrappedConstantValue = Util.toBoolean(fieldConstant.booleanValue());
break;
case TypeIds.T_long :
this.wrappedConstantValue = new Long(fieldConstant.longValue());
break;
case TypeIds.T_JavaLangString :
this.wrappedConstantValue = fieldConstant.stringValue();
}
}
}
return this.wrappedConstantValue;
}
示例11: generateAssignment
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Check and/or redirect the field access to the delegate receiver if any
*/
public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
super.generateAssignment(currentScope, codeStream, assignment, valueRequired);
return;
}
lastFieldBinding = generateReadSequence(currentScope, codeStream);
codeStream.generateEmulationForField(lastFieldBinding);
codeStream.swap();
assignment.expression.generateCode(currentScope, codeStream, true);
if (valueRequired) {
switch (lastFieldBinding.type.id) {
case TypeIds.T_long :
case TypeIds.T_double :
codeStream.dup2_x2();
break;
default :
codeStream.dup_x2();
break;
}
}
codeStream.generateEmulatedWriteAccessForField(lastFieldBinding);
if (valueRequired) {
codeStream.generateImplicitConversion(assignment.implicitConversion);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:30,代码来源:CodeSnippetQualifiedNameReference.java
示例12: getAnnotationMemberValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public static Object getAnnotationMemberValue(MemberValuePair memberValuePair, Constant constant) {
if (constant == null) {
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
switch (constant.typeID()) {
case TypeIds.T_int :
memberValuePair.valueKind = IMemberValuePair.K_INT;
return new Integer(constant.intValue());
case TypeIds.T_byte :
memberValuePair.valueKind = IMemberValuePair.K_BYTE;
return new Byte(constant.byteValue());
case TypeIds.T_short :
memberValuePair.valueKind = IMemberValuePair.K_SHORT;
return new Short(constant.shortValue());
case TypeIds.T_char :
memberValuePair.valueKind = IMemberValuePair.K_CHAR;
return new Character(constant.charValue());
case TypeIds.T_float :
memberValuePair.valueKind = IMemberValuePair.K_FLOAT;
return new Float(constant.floatValue());
case TypeIds.T_double :
memberValuePair.valueKind = IMemberValuePair.K_DOUBLE;
return new Double(constant.doubleValue());
case TypeIds.T_boolean :
memberValuePair.valueKind = IMemberValuePair.K_BOOLEAN;
return Boolean.valueOf(constant.booleanValue());
case TypeIds.T_long :
memberValuePair.valueKind = IMemberValuePair.K_LONG;
return new Long(constant.longValue());
case TypeIds.T_JavaLangString :
memberValuePair.valueKind = IMemberValuePair.K_STRING;
return constant.stringValue();
default:
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
}
示例13: generatePostIncrement
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {
this.receiver.generateCode(currentScope, codeStream, true);
if (this.receiver instanceof CastExpression // ((type[])null)[0]
&& ((CastExpression)this.receiver).innermostCastedExpression().resolvedType == TypeBinding.NULL){
codeStream.checkcast(this.receiver.resolvedType);
}
this.position.generateCode(currentScope, codeStream, true);
codeStream.dup2();
codeStream.arrayAt(this.resolvedType.id);
if (valueRequired) {
switch(this.resolvedType.id) {
case TypeIds.T_long :
case TypeIds.T_double :
codeStream.dup2_x2();
break;
default :
codeStream.dup_x2();
break;
}
}
codeStream.generateImplicitConversion(this.implicitConversion);
codeStream.generateConstant(
postIncrement.expression.constant,
this.implicitConversion);
codeStream.sendOperator(postIncrement.operator, this.implicitConversion & TypeIds.COMPILE_TYPE_MASK);
codeStream.generateImplicitConversion(
postIncrement.preAssignImplicitConversion);
codeStream.arrayAtPut(this.resolvedType.id, false);
}
示例14: generatePostIncrement
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {
FieldBinding lastFieldBinding = this.otherBindings == null ? (FieldBinding) this.binding : this.otherBindings[this.otherBindings.length-1];
if (lastFieldBinding.canBeSeenBy(getFinalReceiverType(), this, currentScope)) {
super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired);
return;
}
lastFieldBinding = generateReadSequence(currentScope, codeStream);
codeStream.generateEmulatedReadAccessForField(lastFieldBinding);
if (valueRequired) {
switch (lastFieldBinding.type.id) {
case TypeIds.T_long :
case TypeIds.T_double :
codeStream.dup2();
break;
default :
codeStream.dup();
break;
}
}
codeStream.generateEmulationForField(lastFieldBinding);
if ((lastFieldBinding.type == TypeBinding.LONG) || (lastFieldBinding.type == TypeBinding.DOUBLE)) {
codeStream.dup_x2();
codeStream.pop();
if (lastFieldBinding.isStatic()) {
codeStream.aconst_null();
} else {
generateReadSequence(currentScope, codeStream);
}
codeStream.dup_x2();
codeStream.pop();
} else {
codeStream.dup_x1();
codeStream.pop();
if (lastFieldBinding.isStatic()) {
codeStream.aconst_null();
} else {
generateReadSequence(currentScope, codeStream);
}
codeStream.dup_x1();
codeStream.pop();
}
codeStream.generateConstant(postIncrement.expression.constant, this.implicitConversion);
codeStream.sendOperator(postIncrement.operator, lastFieldBinding.type.id);
codeStream.generateImplicitConversion(postIncrement.preAssignImplicitConversion);
codeStream.generateEmulatedWriteAccessForField(lastFieldBinding);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:47,代码来源:CodeSnippetQualifiedNameReference.java
示例15: generatePostIncrement
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {
boolean isStatic;
FieldBinding codegenBinding = this.binding.original();
if (codegenBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {
super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired);
} else {
this.receiver.generateCode(currentScope, codeStream, !(isStatic = codegenBinding.isStatic()));
if (isStatic) {
codeStream.aconst_null();
}
// the actual stack is: receiver
codeStream.dup();
// the actual stack is: receiver receiver
codeStream.generateEmulatedReadAccessForField(codegenBinding);
// the actual stack is: receiver value
// receiver value
// value receiver value dup_x1 or dup2_x1 if value required
// value value receiver value dup_x1 or dup2_x1
// value value receiver pop or pop2
// value value receiver field generateEmulationForField
// value value field receiver swap
// value field receiver value field receiver dup2_x1 or dup2_x2
// value field receiver value pop2
// value field receiver newvalue generate constant + op
// value store
int typeID;
switch (typeID = codegenBinding.type.id) {
case TypeIds.T_long :
case TypeIds.T_double :
if (valueRequired) {
codeStream.dup2_x1();
}
codeStream.dup2_x1();
codeStream.pop2();
break;
default :
if (valueRequired) {
codeStream.dup_x1();
}
codeStream.dup_x1();
codeStream.pop();
break;
}
codeStream.generateEmulationForField(codegenBinding);
codeStream.swap();
switch (typeID) {
case TypeIds.T_long :
case TypeIds.T_double :
codeStream.dup2_x2();
break;
default :
codeStream.dup2_x1();
break;
}
codeStream.pop2();
codeStream.generateConstant(postIncrement.expression.constant, this.implicitConversion);
codeStream.sendOperator(postIncrement.operator, codegenBinding.type.id);
codeStream.generateImplicitConversion(postIncrement.preAssignImplicitConversion);
codeStream.generateEmulatedWriteAccessForField(codegenBinding);
}
}