Java Code Examples for org.eclipse.jdt.core.Signature#C_GENERIC_START

The following examples show how to use org.eclipse.jdt.core.Signature#C_GENERIC_START . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SignatureUtil.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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;
}
 
Example 2
Source File: SourceMapper.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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;
}