JDK 11 jdk.jcmd.jmod - JCmd Tool

JDK 11 jdk.jcmd.jmod is the JMOD file for JDK 11 JCmd tool, which can be invoked by the "jcmd" command.

JDK 11 JCmd tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jcmd.jmod.

JDK 11 JCmd tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.

JDK 11 JCmd source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.jcmd.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

sun/tools/jstat/HeaderClosure.java

/*
 * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package sun.tools.jstat;

import sun.jvmstat.monitor.MonitorException;

/**
 * A class implementing the Closure interface that visits the nodes of
 * the nodes of a ColumFormat object and computes the header string for
 * the columns of data.
 *
 * @author Brian Doherty
 * @since 1.5
 */
public class HeaderClosure implements Closure {
    private static final char ALIGN_CHAR = '^';

    private StringBuilder header = new StringBuilder();

    /*
     * visit an object to perform some operation. In this case, the
     * object is a ColumnFormat we are building the header string.
     */
    public void visit(Object o, boolean hasNext) throws MonitorException {

        if (! (o instanceof ColumnFormat)) {
            return;
        }

        ColumnFormat c = (ColumnFormat)o;

        String h = c.getHeader();

        // check for special alignment character
        if (h.indexOf(ALIGN_CHAR) >= 0) {
            int len = h.length();
            if ((h.charAt(0) == ALIGN_CHAR)
                    && (h.charAt(len-1) == ALIGN_CHAR)) {
                // ^<header>^ case - center alignment
                c.setWidth(Math.max(c.getWidth(),
                                    Math.max(c.getFormat().length(), len-2)));
                h = h.substring(1, len-1);
                h = Alignment.CENTER.align(h, c.getWidth());
            } else if (h.charAt(0) == ALIGN_CHAR) {
                // ^<header> case - left alignment
                c.setWidth(Math.max(c.getWidth(),
                                    Math.max(c.getFormat().length(), len-1)));
                h = h.substring(1, len);
                h = Alignment.LEFT.align(h, c.getWidth());
            } else if (h.charAt(len-1) == ALIGN_CHAR) {
                // <header>^ case - right alignment
                c.setWidth(Math.max(c.getWidth(),
                           Math.max(c.getFormat().length(), len-1)));
                h = h.substring(0, len-1);
                h = Alignment.RIGHT.align(h, c.getWidth());
            } else {
                // an internal alignment character - ignore
            }
        } else {
            // User has provided their own padding for alignment purposes
        }

        header.append(h);
        if (hasNext) {
            header.append(" ");
        }
    }

    /*
     * get the header string.
     */
    public String getHeader() {
        return header.toString();
    }
}

sun/tools/jstat/HeaderClosure.java

 

Or download all of them as a single archive file:

File name: jdk.jcmd-11.0.1-src.zip
File size: 47892 bytes
Release date: 2018-11-04
Download 

 

JDK 11 jdk.jconsole.jmod - JConsole Tool

JDK 11 jdk.javadoc.jmod - Java Document Tool

Download and Use JDK 11

⇑⇑ FAQ for JDK (Java Development Kit)

2020-07-07, 13906👍, 0💬