internal JMethod(JClass declaringClass, string name, string sig, bool isStatic, IntPtr methodID) : base(methodID) { this.declaringClass = declaringClass; this.name = name; this.isStatic = isStatic; this.sig = sig; this.rType = JMethodReturnType.INVALID; }
void DetermineReturnType() { int l = sig.LastIndexOf (')'); if (l < -1) { throw new SystemException ("Unreachable reached"); } string ending = sig.Substring (l + 1); isArray = (ending[0] == '['); char c = isArray ? ending[1] : ending[0]; switch (c) { case 'Z': rType = JMethodReturnType.BOOL; break; case 'B': rType = JMethodReturnType.BYTE; break; case 'C': rType = JMethodReturnType.CHAR; break; case 'S': rType = JMethodReturnType.SHORT; break; case 'I': rType = JMethodReturnType.INT; break; case 'J': rType = JMethodReturnType.LONG; break; case 'F': rType = JMethodReturnType.FLOAT; break; case 'D': rType = JMethodReturnType.DOUBLE; break; case 'V': rType = JMethodReturnType.VOID; break; case 'L': rType = JMethodReturnType.OBJECT; break; default: throw new SystemException ("Unreachable reached"); } }