package com.cidat.proclets;

public class EqualsProclet implements Proclet {
	String expr1;
	String expr2;
	Proclet ifEqualsProclet;
	Proclet ifNotEqualsProclet;

	public EqualsProclet(String expr1, String expr2, Proclet procletIfTrue,
			Proclet procletIfFalse) {
		this.expr1 = expr1;
		this.expr2 = expr2;
		this.ifEqualsProclet = procletIfTrue;
		this.ifNotEqualsProclet = procletIfFalse;
	}

	public void process(ProcletServiceData sd) throws ProcletException {
		boolean equals = sd.evalExpr(this.expr1)
				.equals(sd.evalExpr(this.expr2));

		if ((equals) && (this.ifEqualsProclet != null))
			this.ifEqualsProclet.process(sd);
		else if ((!equals) && (this.ifNotEqualsProclet != null))
			this.ifNotEqualsProclet.process(sd);
	}
}

/*
 * Location:
 * D:\svn\ejie\q53.trunk\codigo\q53\q53ItourbaskWar\WebContent\WEB-INF\
 * lib\proclets_wl81.jar Qualified Name: com.cidat.proclets.EqualsProclet
 * JD-Core Version: 0.6.0
 */