Search in sources :

Example 1 with Mathod

use of io.github.ihongs.CoreRoster.Mathod in project HongsCORE by ihongs.

the class Common method showActions.

@Cmdlet("show-actions")
public static void showActions(String[] args) {
    Map<String, String> a = new TreeMap(new PathComparator('/'));
    int i = 0, j;
    for (Map.Entry<String, Mathod> et : ActionRunner.getActions().entrySet()) {
        String k = et.getKey();
        Mathod v = et.getValue();
        a.put(k, v.toString());
        j = k.length();
        if (i < j && j < 39) {
            i = j;
        }
    }
    PrintStream out = CmdletHelper.OUT.get();
    for (Map.Entry<String, String> n : a.entrySet()) {
        StringBuilder s = new StringBuilder();
        s.append(n.getKey());
        for (j = n.getKey().length(); j < i; j++) {
            s.append(" ");
        }
        s.append("\t");
        s.append(n.getValue());
        out.println(s);
    }
}
Also used : PrintStream(java.io.PrintStream) TreeMap(java.util.TreeMap) HashMap(java.util.HashMap) TreeMap(java.util.TreeMap) Map(java.util.Map) Mathod(io.github.ihongs.CoreRoster.Mathod) Cmdlet(io.github.ihongs.cmdlet.anno.Cmdlet)

Aggregations

Mathod (io.github.ihongs.CoreRoster.Mathod)1 Cmdlet (io.github.ihongs.cmdlet.anno.Cmdlet)1 PrintStream (java.io.PrintStream)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1