package background.systemVariables;

public class BooleanVariable extends SimpleVariable {
	public Boolean value;
	
	/* ============================================= */

	public BooleanVariable(Boolean xValue) {
		this.setValue(xValue);
		this.setVizualize(false);
	}

	public BooleanVariable(Boolean xValue, Boolean viz) {
		this.setValue(xValue);
		this.setVizualize(viz);
	}

	public BooleanVariable(String s) {
		if (s.equals("true")) this.setValue(true);
		else this.setValue(false);
		this.setVizualize(false);
	}

	public BooleanVariable(String s, Boolean viz) {
		if (s.equals("true")) this.setValue(true);
		else this.setValue(false); 
		this.setVizualize(viz);
	}
	
	/* ============================================= */
	
	public void setValue(Boolean xValue) {
		super.setValue();
		value = xValue;
	}
	
	public void setValue(String s) {
		if (s.equals("true")) { this.setValue(true); }
		else this.setValue(false);
	}

	
	@Override
	public String getType() {
		return "boolean";
	}
	
	@Override
	public Boolean getValue(Boolean s) {
		return value;
	}	

	public String getValue(String s) {
		return Boolean.toString(value);
	}

}
