本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2类的典型用法代码示例。如果您正苦于以下问题:Java ArrayTypeVariable2类的具体用法?Java ArrayTypeVariable2怎么用?Java ArrayTypeVariable2使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArrayTypeVariable2类属于org.eclipse.jdt.internal.corext.refactoring.typeconstraints2包,在下文中一共展示了ArrayTypeVariable2类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeArrayTypeVariable
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2; //导入依赖的package包/类
private ArrayTypeVariable2 makeArrayTypeVariable(ArrayType type) {
ArrayTypeVariable2 cv = new ArrayTypeVariable2(type);
ArrayTypeVariable2 storedCv = (ArrayTypeVariable2) storedCv(cv);
if (cv == storedCv) {
fCuScopedConstraintVariables.add(storedCv);
makeArrayElementVariable(storedCv);
if (fStoreToString)
storedCv.setData(
ConstraintVariable2.TO_STRING,
"ArrayType(" + type.getPrettySignature() + ")"); // $NON-NLS-1$ //$NON-NLS-2$
}
return storedCv;
}
示例2: createInitialEstimate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2; //导入依赖的package包/类
private TypeSet createInitialEstimate(ConstraintVariable2 cv) {
// TODO: check assumption: only immutable CVs have a type
// ParametricStructure parametricStructure= fElemStructureEnv.elemStructure(cv);
// if (parametricStructure != null && parametricStructure !=
// ParametricStructureComputer.ParametricStructure.NONE) {
// return SubTypesOfSingleton.create(parametricStructure.getBase());
// }
TType type = cv.getType();
if (type == null) {
return fTypeSetEnvironment.getUniverseTypeSet();
} else if (cv instanceof IndependentTypeVariable2) {
return fTypeSetEnvironment.getUniverseTypeSet();
// TODO: solve problem with recursive bounds
// TypeVariable tv= (TypeVariable) type;
// TType[] bounds= tv.getBounds();
// TypeSet result= SubTypesOfSingleton.create(bounds[0].getErasure());
// for (int i= 1; i < bounds.length; i++) {
// result= result.intersectedWith(SubTypesOfSingleton.create(bounds[i].getErasure()));
// }
// return result;
} else if (cv instanceof ArrayTypeVariable2) {
return fTypeSetEnvironment.getUniverseTypeSet();
} else if (cv instanceof ArrayElementVariable2) {
if (cv.getType() != null && cv.getType().isTypeVariable()) {
return fTypeSetEnvironment.getUniverseTypeSet();
} else {
return new SingletonTypeSet(type, fTypeSetEnvironment);
}
} else if (type.isVoidType()) {
return fTypeSetEnvironment.getEmptyTypeSet();
} else {
return new SingletonTypeSet(type, fTypeSetEnvironment);
}
}
示例3: findCastsToRemove
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2; //导入依赖的package包/类
private void findCastsToRemove(CastVariable2[] castVariables) {
for (int i = 0; i < castVariables.length; i++) {
CastVariable2 castCv = castVariables[i];
ConstraintVariable2 expressionVariable = castCv.getExpressionVariable();
TType chosenType = InferTypeArgumentsConstraintsSolver.getChosenType(expressionVariable);
TType castType = castCv.getType();
TType expressionType = expressionVariable.getType();
if (chosenType != null && TTypes.canAssignTo(chosenType, castType)) {
if (chosenType.equals(expressionType))
continue; // The type has not changed. Don't remove the cast, since it could be
// there to get access to default-visible members or to
// unify types of conditional expressions.
fUpdate.addCastToRemove(castCv);
} else if (expressionVariable instanceof ArrayTypeVariable2
&& castType.isArrayType()) { // bug 97258
ArrayElementVariable2 arrayElementCv = fTCModel.getArrayElementVariable(expressionVariable);
if (arrayElementCv == null) continue;
TType chosenArrayElementType =
InferTypeArgumentsConstraintsSolver.getChosenType(arrayElementCv);
if (chosenArrayElementType != null
&& TTypes.canAssignTo(
chosenArrayElementType, ((ArrayType) castType).getComponentType())) {
if (expressionType instanceof ArrayType
&& chosenArrayElementType.equals(((ArrayType) expressionType).getComponentType()))
continue; // The type has not changed. Don't remove the cast, since it could be
// there to unify types of conditional expressions.
fUpdate.addCastToRemove(castCv);
}
}
}
}
示例4: makeArrayTypeVariable
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2; //导入依赖的package包/类
private ArrayTypeVariable2 makeArrayTypeVariable(ArrayType type) {
ArrayTypeVariable2 cv= new ArrayTypeVariable2(type);
ArrayTypeVariable2 storedCv= (ArrayTypeVariable2) storedCv(cv);
if (cv == storedCv) {
fCuScopedConstraintVariables.add(storedCv);
makeArrayElementVariable(storedCv);
if (fStoreToString)
storedCv.setData(ConstraintVariable2.TO_STRING, "ArrayType(" + type.getPrettySignature() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
}
return storedCv;
}
示例5: createInitialEstimate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2; //导入依赖的package包/类
private TypeSet createInitialEstimate(ConstraintVariable2 cv) {
// TODO: check assumption: only immutable CVs have a type
// ParametricStructure parametricStructure= fElemStructureEnv.elemStructure(cv);
// if (parametricStructure != null && parametricStructure != ParametricStructureComputer.ParametricStructure.NONE) {
// return SubTypesOfSingleton.create(parametricStructure.getBase());
// }
TType type= cv.getType();
if (type == null) {
return fTypeSetEnvironment.getUniverseTypeSet();
} else if (cv instanceof IndependentTypeVariable2) {
return fTypeSetEnvironment.getUniverseTypeSet();
//TODO: solve problem with recursive bounds
// TypeVariable tv= (TypeVariable) type;
// TType[] bounds= tv.getBounds();
// TypeSet result= SubTypesOfSingleton.create(bounds[0].getErasure());
// for (int i= 1; i < bounds.length; i++) {
// result= result.intersectedWith(SubTypesOfSingleton.create(bounds[i].getErasure()));
// }
// return result;
} else if (cv instanceof ArrayTypeVariable2) {
return fTypeSetEnvironment.getUniverseTypeSet();
} else if (cv instanceof ArrayElementVariable2) {
if (cv.getType() != null && cv.getType().isTypeVariable()) {
return fTypeSetEnvironment.getUniverseTypeSet();
} else {
return new SingletonTypeSet(type, fTypeSetEnvironment);
}
} else if (type.isVoidType()) {
return fTypeSetEnvironment.getEmptyTypeSet();
} else {
return new SingletonTypeSet(type, fTypeSetEnvironment);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:38,代码来源:InferTypeArgumentsConstraintsSolver.java
示例6: findCastsToRemove
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2; //导入依赖的package包/类
private void findCastsToRemove(CastVariable2[] castVariables) {
for (int i= 0; i < castVariables.length; i++) {
CastVariable2 castCv= castVariables[i];
ConstraintVariable2 expressionVariable= castCv.getExpressionVariable();
TType chosenType= InferTypeArgumentsConstraintsSolver.getChosenType(expressionVariable);
TType castType= castCv.getType();
TType expressionType= expressionVariable.getType();
if (chosenType != null && TTypes.canAssignTo(chosenType, castType)) {
if (chosenType.equals(expressionType))
continue; // The type has not changed. Don't remove the cast, since it could be
// there to get access to default-visible members or to
// unify types of conditional expressions.
fUpdate.addCastToRemove(castCv);
} else if (expressionVariable instanceof ArrayTypeVariable2 && castType.isArrayType()) { // bug 97258
ArrayElementVariable2 arrayElementCv= fTCModel.getArrayElementVariable(expressionVariable);
if (arrayElementCv == null)
continue;
TType chosenArrayElementType= InferTypeArgumentsConstraintsSolver.getChosenType(arrayElementCv);
if (chosenArrayElementType != null && TTypes.canAssignTo(chosenArrayElementType, ((ArrayType) castType).getComponentType())) {
if (expressionType instanceof ArrayType && chosenArrayElementType.equals(((ArrayType) expressionType).getComponentType()))
continue; // The type has not changed. Don't remove the cast, since it could be
// there to unify types of conditional expressions.
fUpdate.addCastToRemove(castCv);
}
}
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:InferTypeArgumentsConstraintsSolver.java