Newer
Older
AlgebraicDataflowArchitectureModel / AlgebraicDataflowArchitectureModel / src / models / dataConstraintModel / ChannelMember.java
package models.dataConstraintModel;

import java.util.ArrayList;
import java.util.List;

public class ChannelMember {
	private ResourcePath resourcePath = null;
	private StateTransition stateTransition = null;
	private boolean isOutside = false;
	
	public ChannelMember(ResourcePath resourcePath) {
		this.resourcePath = resourcePath;
		stateTransition = new StateTransition();
		isOutside = false;
	}

	public ResourcePath getResource() {
		return resourcePath;
	}

	public void setResource(ResourcePath resourcePath) {
		this.resourcePath = resourcePath;
	}

	public StateTransition getStateTransition() {
		return stateTransition;
	}

	public void setStateTransition(StateTransition stateTransition) {
		this.stateTransition = stateTransition;
	}
	
	public boolean isOutside() {
		return this.isOutside;
	}

	public void setOutside(boolean isOutside) {
		this.isOutside = isOutside;
	}
	
	@Override
	public String toString() {
		if (stateTransition.getNextStateExpression() == null) {
			return resourcePath.getLeafResourceName() + "("
					+ stateTransition.getCurStateExpression() + ","
					+ stateTransition.getMessageExpression() + ")";
		}
		return resourcePath.getLeafResourceName() + "("
					+ stateTransition.getCurStateExpression() + ","
					+ stateTransition.getMessageExpression() + ")"
					+ " == " + stateTransition.getNextStateExpression();
	}
}