All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netgrif.application.engine.petrinet.domain.arcs.PTArc Maven / Gradle / Ivy

Go to download

System provides workflow management functions including user, role and data management.

There is a newer version: 6.3.3
Show newest version
package com.netgrif.application.engine.petrinet.domain.arcs;

import com.netgrif.application.engine.petrinet.domain.Node;
import com.netgrif.application.engine.petrinet.domain.Place;
import com.netgrif.application.engine.petrinet.domain.Transition;

/**
 * Special arcs that can only lead from Place to Transition (thus PT).
 */
public abstract class PTArc extends Arc {

    /**
     * Sets source of this arc.
     *
     * @param source Node object of class Place
     * @throws IllegalArgumentException if source is of class Transition
     */
    @Override
    public void setSource(Node source) {
        if (source instanceof Transition)
            throw new IllegalArgumentException(this.getClass().getSimpleName() + " can not lead from a Transition");
        super.setSource(source);
    }

    /**
     * Sets destination of this arc.
     *
     * @param destination Node object of class Transition
     * @throws IllegalArgumentException if destination is of class Place
     */
    @Override
    public void setDestination(Node destination) {
        if (destination instanceof Place)
            throw new IllegalArgumentException(this.getClass().getSimpleName() + " can not lead to a Place");
        super.setDestination(destination);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy