Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.reflect.Method;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Main {
    private static Map<Class, Method[]> methodCacheTable = new ConcurrentHashMap<Class, Method[]>();

    public static Method[] getMethods(Class clazz) {
        Method[] ms = methodCacheTable.get(clazz);
        if (null == ms) {
            ms = clazz.getMethods();
            methodCacheTable.put(clazz, ms);
        }
        return ms;
    }
}