public CtMethod[] getDeclaredMethods() {
        CtMember.Cache memCache = getMembers();
        CtMember mth = memCache.methodHead();
        CtMember mthTail = memCache.lastMethod();
        int num = CtMember.Cache.count(mth, mthTail);
        CtMethod[] cms = new CtMethod[num];
        int i = 0;
        while (mth != mthTail) {
            mth = mth.next();
            cms[i++] = (CtMethod)mth;
        }

        return cms;
    }