本文整理汇总了Java中org.eclipse.jdt.core.Signature.C_GENERIC_END属性的典型用法代码示例。如果您正苦于以下问题:Java Signature.C_GENERIC_END属性的具体用法?Java Signature.C_GENERIC_END怎么用?Java Signature.C_GENERIC_END使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.Signature
的用法示例。
在下文中一共展示了Signature.C_GENERIC_END属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: typeEnd
private static int typeEnd(char[] signature, int pos) {
int depth = 0;
while (pos < signature.length) {
switch (signature[pos]) {
case Signature.C_GENERIC_START:
depth++;
break;
case Signature.C_GENERIC_END:
if (depth == 0) return pos;
depth--;
break;
case Signature.C_SEMICOLON:
if (depth == 0) return pos + 1;
break;
}
pos++;
}
return pos + 1;
}
示例2: findMatchingGenericEnd
private int findMatchingGenericEnd(char[] sig, int start) {
int nesting = 0;
int length = sig.length;
for (int i = start; i < length; i++) {
switch (sig[i]) {
case Signature.C_GENERIC_START:
nesting++;
break;
case Signature.C_GENERIC_END:
if (nesting == 0) return i;
nesting--;
break;
}
}
return -1;
}
示例3: scanGenericEnd
private static int scanGenericEnd(char[] string, int start) {
if (string[start] == Signature.C_GENERIC_END) {
return start;
}
int length = string.length;
int balance = 1;
start++;
while (start <= length) {
switch (string[start]) {
case Signature.C_GENERIC_END:
balance--;
if (balance == 0) {
return start;
}
break;
case Signature.C_GENERIC_START:
balance++;
break;
}
start++;
}
return start;
}
示例4: toUnresolvedTypeSignature
private static int toUnresolvedTypeSignature(
char[] signature, int start, int length, StringBuffer buffer) {
if (signature[start] == Signature.C_RESOLVED) buffer.append(Signature.C_UNRESOLVED);
else buffer.append(signature[start]);
for (int i = start + 1; i < length; i++) {
char c = signature[i];
switch (c) {
case '/':
case Signature.C_DOLLAR:
buffer.append(Signature.C_DOT);
break;
case Signature.C_GENERIC_START:
buffer.append(Signature.C_GENERIC_START);
i = toUnresolvedTypeSignature(signature, i + 1, length, buffer);
break;
case Signature.C_GENERIC_END:
buffer.append(Signature.C_GENERIC_END);
return i;
default:
buffer.append(c);
break;
}
}
return length;
}