Sha256: 061a74d486c28abf1e28047f42fae0747ec08ac5f6d1d234d42ed2b15466da50

Contents?: true

Size: 1.79 KB

Versions: 12

Compression:

Stored size: 1.79 KB

Contents

package org.cx4a.rsense.typing.vertex;

import org.jrubyparser.ast.Node;

import org.cx4a.rsense.ruby.Block;
import org.cx4a.rsense.typing.Propagation;
import org.cx4a.rsense.typing.Template;

public class YieldVertex extends Vertex {
    private Template template;
    private Block block;
    private Vertex argsVertex;
    private boolean expandArguments;

    public YieldVertex(Node node, Template template, Block block, Vertex argsVertex, boolean expandArguments) {
        super(node);
        this.template = template;
        this.block = block;
        this.argsVertex = argsVertex;
        this.expandArguments = expandArguments;
        if (argsVertex != null) {
            argsVertex.addEdge(this);
        }
    }

    public Template getTemplate() {
        return template;
    }

    public Block getBlock() {
        return block;
    }

    public Vertex getArgsVertex() {
        return argsVertex;
    }

    public boolean getExpandArguments() {
        return expandArguments;
    }

    @Override
    public boolean accept(Propagation propagation, Vertex src) {
        return propagation.getGraph().propagateYieldVertex(propagation, this, src);
    }

    @Override
    public int hashCode() {
        return template == null ? block.hashCode() : template.getAttribute().hashCode();
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }

        if (!(other instanceof YieldVertex)) {
            return false;
        }

        YieldVertex o = (YieldVertex) other;
        return (template == null
                && o.template == null
                && block.equals(o.block))
            || (template != null
                && o.template != null
                && template.getAttribute().equals(o.template.getAttribute()));
    }
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rsense-core-0.6.6 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.6.5 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.6.4 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.6.2 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.6.1 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.6.0 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.5.9 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.5.8 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.5.6 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.5.2 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.5.1 src/org/cx4a/rsense/typing/vertex/YieldVertex.java
rsense-core-0.5.0 src/org/cx4a/rsense/typing/vertex/YieldVertex.java