| 85 | |
| 86 | public static final class TypeParameter implements PotentialComparable<TypeParameter> { |
| 87 | static TypeParameter parse(String sig, MutableInt pos, ClassEnv env) { |
| 88 | // Identifier ':' ReferenceTypeSignature ( ':' ReferenceTypeSignature )* |
| 89 | TypeParameter ret = new TypeParameter(); |
| 90 | |
| 91 | int idEnd = sig.indexOf(':', pos.val); |
| 92 | ret.identifier = sig.substring(pos.val, idEnd); |
| 93 | pos.val = idEnd + 1; |
| 94 | |
| 95 | char next = sig.charAt(pos.val); |
| 96 | |
| 97 | if (next == 'L' || next == 'T' || next == '[') { |
| 98 | ret.classBound = ReferenceTypeSignature.parse(sig, pos, env); |
| 99 | } |
| 100 | |
| 101 | if (sig.charAt(pos.val) == ':') { |
| 102 | ret.interfaceBounds = new ArrayList<>(); |
| 103 | |
| 104 | do { |
| 105 | pos.val++; |
| 106 | ret.interfaceBounds.add(ReferenceTypeSignature.parse(sig, pos, env)); |
| 107 | } while (sig.charAt(pos.val) == ':'); |
| 108 | } |
| 109 | |
| 110 | return ret; |
| 111 | } |
| 112 | |
| 113 | public String getIdentifier() { |
| 114 | return identifier; |