com.sun.hotspot.igv.data.Properties.StringPropertyMatcher Java Examples

The following examples show how to use com.sun.hotspot.igv.data.Properties.StringPropertyMatcher. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BytecodeNode.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example #2
Source File: BytecodeNode.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example #3
Source File: BytecodeNode.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example #4
Source File: BytecodeNode.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example #5
Source File: BytecodeNode.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        String displayName = bytecode.getBci() + " " + bytecode.getName() + " " + bytecode.getOperands();

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new LinkedHashSet<>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            displayName += " (" + nodes.size() + " nodes)";
        }

        if (bytecode.getComment() != null) {
            displayName += " // " + bytecode.getComment();
        }

        this.setDisplayName(displayName);
    }
 
Example #6
Source File: Diagram.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public Figure getRootFigure() {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<>(figures);
    Figure root = selector.selectSingle(new StringPropertyMatcher("name", "Root"));
    if (root == null) {
        root = selector.selectSingle(new StringPropertyMatcher("name", "Start"));
    }
    if (root == null) {
        List<Figure> rootFigures = getRootFigures();
        if (rootFigures.size() > 0) {
            root = rootFigures.get(0);
        } else if (figures.size() > 0) {
            root = figures.get(0);
        }
    }

    return root;
}
 
Example #7
Source File: BytecodeNode.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example #8
Source File: BytecodeNode.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example #9
Source File: BytecodeNode.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example #10
Source File: PropertiesTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Test property selector
 */
public void testPropertySelector() {
    final Collection<Properties.Entity> c = new ArrayList<>();

    final Properties.Entity e1 = new Properties.Entity();
    e1.getProperties().setProperty("p1", "1");
    e1.getProperties().setProperty("p2", "2");
    c.add(e1);

    final Properties.Entity e2 = new Properties.Entity();
    e2.getProperties().setProperty("p2", "2");
    e2.getProperties().setProperty("p1", "1");
    e2.getProperties().setProperty("p3", "3");
    c.add(e2);

    final Properties.Entity e3 = new Properties.Entity();
    e3.getProperties().setProperty("p3", "3");
    e3.getProperties().setProperty("p4", "4");
    c.add(e3);

    final PropertySelector<Properties.Entity> sel = new PropertySelector<>(c);

    final StringPropertyMatcher matcher1 = new StringPropertyMatcher("p2", "2");
    assertTrue(sel.selectMultiple(matcher1).size() == 2);
    assertTrue(sel.selectMultiple(matcher1).contains(e1));
    assertTrue(sel.selectMultiple(matcher1).contains(e2));
    assertTrue(sel.selectSingle(matcher1).equals(e1) || sel.selectSingle(matcher1).equals(e2));

    final StringPropertyMatcher matcher2 = new StringPropertyMatcher("p3", "3");
    assertTrue(sel.selectMultiple(matcher2).size() == 2);
    assertTrue(sel.selectMultiple(matcher2).contains(e2));
    assertTrue(sel.selectMultiple(matcher2).contains(e3));
    assertTrue(sel.selectSingle(matcher2).equals(e2) || sel.selectSingle(matcher2).equals(e3));

    final StringPropertyMatcher matcher3 = new StringPropertyMatcher("p4", "4");
    assertTrue(sel.selectMultiple(matcher3).size() == 1);
    assertTrue(sel.selectMultiple(matcher3).contains(e3));
    assertTrue(sel.selectSingle(matcher3).equals(e3));

    final StringPropertyMatcher matcher4 = new StringPropertyMatcher("p5", "5");
    assertTrue(sel.selectMultiple(matcher4).size() == 0);
    assertTrue(sel.selectSingle(matcher4) == null);
}