本文整理汇总了Java中org.eclipse.jdt.core.Signature.C_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java Signature.C_ARRAY属性的具体用法?Java Signature.C_ARRAY怎么用?Java Signature.C_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.Signature
的用法示例。
在下文中一共展示了Signature.C_ARRAY属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendArrayTypeSignature
private static void appendArrayTypeSignature(
char[] string, int start, StringBuffer buffer, boolean compact) {
int length = string.length;
// need a minimum 2 char
if (start >= length - 1) {
throw new IllegalArgumentException();
}
char c = string[start];
if (c != Signature.C_ARRAY) {
throw new IllegalArgumentException();
}
int index = start;
c = string[++index];
while (c == Signature.C_ARRAY) {
// need a minimum 2 char
if (index >= length - 1) {
throw new IllegalArgumentException();
}
c = string[++index];
}
appendTypeSignature(string, index, buffer, compact);
for (int i = 0, dims = index - start; i < dims; i++) {
buffer.append('[').append(']');
}
}
示例2: appendArrayTypeSignatureForAnchor
private static int appendArrayTypeSignatureForAnchor(
char[] string, int start, StringBuffer buffer, boolean isVarArgs) {
int length = string.length;
// need a minimum 2 char
if (start >= length - 1) {
throw new IllegalArgumentException();
}
char c = string[start];
if (c != Signature.C_ARRAY) {
throw new IllegalArgumentException();
}
int index = start;
c = string[++index];
while (c == Signature.C_ARRAY) {
// need a minimum 2 char
if (index >= length - 1) {
throw new IllegalArgumentException();
}
c = string[++index];
}
int e = appendTypeSignatureForAnchor(string, index, buffer, false);
for (int i = 1, dims = index - start; i < dims; i++) {
buffer.append('[').append(']');
}
if (isVarArgs) {
buffer.append('.').append('.').append('.');
} else {
buffer.append('[').append(']');
}
return e;
}
示例3: appendTypeSignature
static void appendTypeSignature(char[] string, int start, StringBuffer buffer, boolean compact) {
char c = string[start];
switch (c) {
case Signature.C_ARRAY:
appendArrayTypeSignature(string, start, buffer, compact);
break;
case Signature.C_RESOLVED:
appendClassTypeSignature(string, start, buffer, compact);
break;
case Signature.C_TYPE_VARIABLE:
int e =
org.eclipse.jdt.internal.compiler.util.Util.scanTypeVariableSignature(string, start);
buffer.append(string, start + 1, e - start - 1);
break;
case Signature.C_BOOLEAN:
buffer.append(BOOLEAN);
break;
case Signature.C_BYTE:
buffer.append(BYTE);
break;
case Signature.C_CHAR:
buffer.append(CHAR);
break;
case Signature.C_DOUBLE:
buffer.append(DOUBLE);
break;
case Signature.C_FLOAT:
buffer.append(FLOAT);
break;
case Signature.C_INT:
buffer.append(INT);
break;
case Signature.C_LONG:
buffer.append(LONG);
break;
case Signature.C_SHORT:
buffer.append(SHORT);
break;
case Signature.C_VOID:
buffer.append(VOID);
break;
}
}
示例4: appendTypeSignatureForAnchor
private static int appendTypeSignatureForAnchor(
char[] string, int start, StringBuffer buffer, boolean isVarArgs) {
// need a minimum 1 char
if (start >= string.length) {
throw new IllegalArgumentException();
}
char c = string[start];
if (isVarArgs) {
switch (c) {
case Signature.C_ARRAY:
return appendArrayTypeSignatureForAnchor(string, start, buffer, true);
case Signature.C_RESOLVED:
case Signature.C_TYPE_VARIABLE:
case Signature.C_BOOLEAN:
case Signature.C_BYTE:
case Signature.C_CHAR:
case Signature.C_DOUBLE:
case Signature.C_FLOAT:
case Signature.C_INT:
case Signature.C_LONG:
case Signature.C_SHORT:
case Signature.C_VOID:
case Signature.C_STAR:
case Signature.C_EXTENDS:
case Signature.C_SUPER:
case Signature.C_CAPTURE:
default:
throw new IllegalArgumentException(); // a var args is an array type
}
} else {
switch (c) {
case Signature.C_ARRAY:
return appendArrayTypeSignatureForAnchor(string, start, buffer, false);
case Signature.C_RESOLVED:
return appendClassTypeSignatureForAnchor(string, start, buffer);
case Signature.C_TYPE_VARIABLE:
int e =
org.eclipse.jdt.internal.compiler.util.Util.scanTypeVariableSignature(string, start);
buffer.append(string, start + 1, e - start - 1);
return e;
case Signature.C_BOOLEAN:
buffer.append(BOOLEAN);
return start;
case Signature.C_BYTE:
buffer.append(BYTE);
return start;
case Signature.C_CHAR:
buffer.append(CHAR);
return start;
case Signature.C_DOUBLE:
buffer.append(DOUBLE);
return start;
case Signature.C_FLOAT:
buffer.append(FLOAT);
return start;
case Signature.C_INT:
buffer.append(INT);
return start;
case Signature.C_LONG:
buffer.append(LONG);
return start;
case Signature.C_SHORT:
buffer.append(SHORT);
return start;
case Signature.C_VOID:
buffer.append(VOID);
return start;
case Signature.C_CAPTURE:
return appendCaptureTypeSignatureForAnchor(string, start, buffer);
case Signature.C_STAR:
case Signature.C_EXTENDS:
case Signature.C_SUPER:
return appendTypeArgumentSignatureForAnchor(string, start, buffer);
default:
throw new IllegalArgumentException();
}
}
}