//
// https://www.ramecera.it/myscrewdriver.html
// e-mail: screwdriver@ramecera.it
//
/* This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0 which accompanies this
 * distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html */
package it.ramecera.screwdriver;

import it.ramecera.salad.everyday.Candies;

/**
 * <p>
 * The assumed tags, i.e. the ones that must be present or absent in the
 * .ele file, with their possible values.
 * </p>
 * <p>
 * Company: Ramecera™<br>
 * Creation date: 2020-04-09<br>
 * Last updated: 2020-04-09
 * </p>
 * <p>
 * Modifications:<br>
 * </p>
 * 
 * @author M. Maglioni */
final public class Imply {

	/** the name of the markup */
	public String stub;
	/** the markup value */
	public String value;
	/** if it must be present (true) or if it must be absent (false) */
	public boolean direct = true;
	/** if it is a wagon type markup, i.e. subsequent, on the same
	 * line */
	public boolean isWagon;

	/**
	 * <p>
	 * Ordinary constructor.
	 * </p>
	 * <p>
	 * Company: Ramecera™<br>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09
	 * </p>
	 * <p>
	 * Modifications:<br>
	 * </p>
	 * 
	 * @param stub the name of the markup
	 * @param value the value of the markup
	 * @param direct if it must be present (true) or if it must be
	 *        absent (false)
	 * @param isWagon if it is a tab of type wagon , that is to say that
	 *        it is found in tow with another, which is called the
	 *        head */
	public Imply(final String stub, final String value,
			final boolean direct, final boolean isWagon) {
		super();
		this.stub = stub;
		this.value = value;
		this.direct = direct;
		this.isWagon = isWagon;
	}

	/**
	 * <p>
	 * Default constructor.
	 * </p>
	 * <p>
	 * Company: Ramecera™<br>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09
	 * </p>
	 * <p>
	 * Modifications:<br>
	 * </p>
	 */
	public Imply() {
	}

	/**
	 * <p>
	 * Classic toString method.
	 * </p>
	 * <p>
	 * Company: Ramecera™<br>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09
	 * </p>
	 * <p>
	 * Modifications:<br>
	 * </p>
	 * 
	 * @param i index of the assumption
	 * @return the compound string */
	public String toString(final int i) {
		String s = "";
		s += "     implied " + i + "): stub = " + stub;
		if (value != null && !value.isEmpty()) {
			s += "; value = " + value;
		}
		s += "; direct = " + direct;
		if (isWagon) {
			s += "; FOLLOWED BY = " + isWagon;
		}
		s += ";" + Candies.LF;
		return s;
	}
}
