本文整理匯總了Java中org.eclipse.jdt.core.dom.Type.isArrayType方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.isArrayType方法的具體用法?Java Type.isArrayType怎麽用?Java Type.isArrayType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.dom.Type
的用法示例。
在下文中一共展示了Type.isArrayType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getVariableNameSuggestions
import org.eclipse.jdt.core.dom.Type; //導入方法依賴的package包/類
private static String[] getVariableNameSuggestions(int variableKind, IJavaProject project, Type expectedType, Collection<String> excluded, boolean evaluateDefault) {
int dim= 0;
if (expectedType.isArrayType()) {
ArrayType arrayType= (ArrayType)expectedType;
dim= arrayType.getDimensions();
expectedType= arrayType.getElementType();
}
if (expectedType.isParameterizedType()) {
expectedType= ((ParameterizedType)expectedType).getType();
}
String typeName= ASTNodes.getTypeName(expectedType);
if (typeName.length() > 0) {
return getVariableNameSuggestions(variableKind, project, typeName, dim, excluded, evaluateDefault);
}
return EMPTY;
}
示例2: getVariableNameSuggestions
import org.eclipse.jdt.core.dom.Type; //導入方法依賴的package包/類
private static String[] getVariableNameSuggestions(
int variableKind,
IJavaProject project,
Type expectedType,
Collection<String> excluded,
boolean evaluateDefault) {
int dim = 0;
if (expectedType.isArrayType()) {
ArrayType arrayType = (ArrayType) expectedType;
dim = arrayType.getDimensions();
expectedType = arrayType.getElementType();
}
if (expectedType.isParameterizedType()) {
expectedType = ((ParameterizedType) expectedType).getType();
}
String typeName = ASTNodes.getTypeName(expectedType);
if (typeName.length() > 0) {
return getVariableNameSuggestions(
variableKind, project, typeName, dim, excluded, evaluateDefault);
}
return EMPTY;
}
示例3: getElementType
import org.eclipse.jdt.core.dom.Type; //導入方法依賴的package包/類
/**
* Returns the element type. This is a convenience method that returns its
* argument if it is a simple type and the element type if the parameter is an array type.
* @param type The type to get the element type from.
* @return The element type of the type or the type itself.
*/
public static Type getElementType(Type type) {
if (! type.isArrayType()) {
return type;
}
return ((ArrayType)type).getElementType();
}
示例4: isVoidArrayType
import org.eclipse.jdt.core.dom.Type; //導入方法依賴的package包/類
private static boolean isVoidArrayType(Type type) {
if (!type.isArrayType()) return false;
ArrayType arrayType = (ArrayType) type;
if (!arrayType.getElementType().isPrimitiveType()) return false;
PrimitiveType primitiveType = (PrimitiveType) arrayType.getElementType();
return (primitiveType.getPrimitiveTypeCode() == PrimitiveType.VOID);
}